From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 9000E7F8E8 for ; Wed, 21 May 2014 18:41:20 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of martin.jambon@ens-lyon.org) identity=pra; client-ip=66.111.4.27; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: Neutral (mail3-smtp-sop.national.inria.fr: domain of martin.jambon@ens-lyon.org does not assert whether or not 66.111.4.27 is permitted sender) identity=mailfrom; client-ip=66.111.4.27; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="martin.jambon@ens-lyon.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@out3-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.27; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="martin.jambon@ens-lyon.org"; x-sender="postmaster@out3-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8BAOnWfFNCbwQbnGdsb2JhbABZg1uDQak0gQeWdgGBDBYOAQEBAQEGDQkJFCiCJQEBBAEjDwEFCC4KAQEPCw4KAgIFBBIIAwICCQMCAQIBDyQBEQYNAQUCAQEOiBsDCQgNr2t3hQWaJQMKhiQRBoEqiw+BKDozB4J1gUsBhGEFhT2NWYMyhRUZhCqCHYlKTQE X-IPAS-Result: Al8BAOnWfFNCbwQbnGdsb2JhbABZg1uDQak0gQeWdgGBDBYOAQEBAQEGDQkJFCiCJQEBBAEjDwEFCC4KAQEPCw4KAgIFBBIIAwICCQMCAQIBDyQBEQYNAQUCAQEOiBsDCQgNr2t3hQWaJQMKhiQRBoEqiw+BKDozB4J1gUsBhGEFhT2NWYMyhRUZhCqCHYlKTQE X-IronPort-AV: E=Sophos;i="4.98,880,1392159600"; d="scan'208";a="63035745" Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 May 2014 18:40:50 +0200 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 1A975210E1; Wed, 21 May 2014 12:40:49 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 21 May 2014 12:40:49 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=EPCmCpyYte/4GvCkGgU/bP yeE+g=; b=I51sLVZQzbnw71IHUE0ki4CpiLvoDzDWU5/fPm4c8jQJhEeLDHUK6R r9FoYfU6cUN7aLqgSG8/yJpvUwpp6OfJrRTj/Po8ejZkuBJicftbi8r/9cWZE+sb FSg2J+agzAnxr+XfpAZKI++jUAiHULcRNGvN2mNssUELnf6bJrjK4= X-Sasl-enc: mmmgquWQDKldD469gZj4Tp59/HZN8TMEpWu1gtjbUOIm 1400690448 Received: from [172.16.71.123] (unknown [50.193.45.145]) by mail.messagingengine.com (Postfix) with ESMTPA id 7F16C680118; Wed, 21 May 2014 12:40:48 -0400 (EDT) Message-ID: <537CD70F.9010503@ens-lyon.org> Date: Wed, 21 May 2014 09:40:47 -0700 From: Martin Jambon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: David House CC: caml users , Ollie Frolovs References: <762DAB52-9D2E-4002-80B0-526258DD7856@my.bristol.ac.uk> <2ABC1954-90FF-41CF-AB18-0C228A51CB8E@my.bristol.ac.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Random.self_init in Jane Street Core On Wed 21 May 2014 05:28:00 AM PDT, David House wrote: > Relatedly, one should be careful using the [ignore] function. Always > give its argument a type signature. E.g. if you do this: > > ignore (my_function foo); > > Then this will start silently not calling [my_function] whenever > someone adds a second argument. You should instead use: > > ignore (my_function foo : Foo.t); I think it used to be a problem but it no longer is. Recent versions of OCaml give a warning when passing a function, so there's no need for a type annotation: $ ocaml OCaml version 4.01.0 # ignore print_endline;; Warning 5: this function application is partial, maybe some arguments are missing. - : unit = () > > On 21 May 2014 13:25, Ollie Frolovs > > wrote: > > oh dear! i think i know what happened. self_init has never been > called in the first place! it requires a unit argument which i did > not give it, so the “alias” to Random.self_init was assigned to > nothing, so to speak, instead of calling the function. > > Many thanks, Dmitry! I’ve amended that line to let () = > Random.self_init () and it works. > > On 21 May 2014, at 13:18, Dmitry Grebeniuk > wrote: > > > Hello. > > > >> let _ = Random.self_init > > > > That's why I almost never use "let _ = ...", or > > constrain "_" to some type when I use it. > > Try to replace it with "let () = ..." and follow compiler > > errors. Or with "let (_ : unit) = ...". > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >