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 035377F8E8 for ; Wed, 21 May 2014 14:28:03 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of dhouse@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; 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@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkMBAOeafFMmachwnGdsb2JhbABZDoNJWIJpqTOBBwGNeIh9AYECCBYOAQEBAQEGFgk8giUBAQQBIx0BASwLAQQLCwQHDQ0dAgIhARIBBQEKEgYTCAqIGwMJCAMCCKN1ixp3hFIBBZonAwqGJBEGjDmBKGkEB4J1gUuEYgWTFoF1gT2JWIIdhAEYKYQoQWwB X-IPAS-Result: AkMBAOeafFMmachwnGdsb2JhbABZDoNJWIJpqTOBBwGNeIh9AYECCBYOAQEBAQEGFgk8giUBAQQBIx0BASwLAQQLCwQHDQ0dAgIhARIBBQEKEgYTCAqIGwMJCAMCCKN1ixp3hFIBBZonAwqGJBEGjDmBKGkEB4J1gUuEYgWTFoF1gT2JWIIdhAEYKYQoQWwB X-IronPort-AV: E=Sophos;i="4.98,879,1392159600"; d="scan'208";a="62988830" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 May 2014 14:28:02 +0200 Received: from tot-smtp.delacy.com ([172.27.22.15] helo=tot-smtp) by mxout1.mail.janestreet.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1Wn5cm-0006RL-Tv for caml-list@inria.fr; Wed, 21 May 2014 08:28:00 -0400 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wn5cm-0006mX-Od for caml-list@inria.fr; Wed, 21 May 2014 08:28:00 -0400 Received: from mail-qc0-f173.google.com ([209.85.216.173]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1Wn5cm-0002Tw-M8 for caml-list@inria.fr; Wed, 21 May 2014 08:28:00 -0400 Received: by mail-qc0-f173.google.com with SMTP id i8so2942803qcq.4 for ; Wed, 21 May 2014 05:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GFyMwvLvZTfB53qK2na4JWtNrMrwlbFb/Keugog9QPo=; b=yB/5+VNZABaWd/73ZQXjgK81kQ8IQf34zV7y4XFoB9OEmk5r8FYMSKuXfDhZ4bR+Or DoKHjsIAnPXW2SQqBEIXEj2oV6gt9dAUt/UpWPm04AAbOrD/LrOsnQAtEZYxvq/uP7rp ckSfGuflt/O3OqyTh+hsJyusd+J6M9P+lHocs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=GFyMwvLvZTfB53qK2na4JWtNrMrwlbFb/Keugog9QPo=; b=YkiCImRoxvDK+5jRUXnCtCTXKuz/EGw58SKBtNEdy+DbOZulIMlfyZQCFuwnvDCJ12 wnKnr8OiTAgTMLm7103WPH3/rG8xhdJ1bRRA/cnACn6KGwaZ3V4froPW2gr3D5drvKTu tlDpBK4/5JBALUPZRHZdjFb8ws3oE+JLvCMhi+XJI/juYiENOeLx7EMGTQLSthir2D1v vkuTO2b2Pz/TlJYRAZ9gyHfYOvnA7qI/P/VYUOEDIB8oJ/WiIptnGN6fPYi2DPMY4bdg +9DXzyjKSAEXAraeCvu3MA+XvefQs/OkNFa1XZYh4gsDwV6aJnGoXTnLuLsBp550uQo/ iiFA== X-Gm-Message-State: ALoCoQmxSwcA85EnnHNeasWmKLNtSbaw+6Tai2/jeL4iHhGwzDg2LcE/OPxvDWjmCJmSO3nVn23Yr7kjAhULcKuTSmqhJD8E4MPCYi1ifDOVWU00x+//PlJ5Icqv7QBcK3vUfWW5Yp8T X-Received: by 10.224.103.129 with SMTP id k1mr67633026qao.62.1400675280540; Wed, 21 May 2014 05:28:00 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.103.129 with SMTP id k1mr67633014qao.62.1400675280461; Wed, 21 May 2014 05:28:00 -0700 (PDT) Received: by 10.140.30.98 with HTTP; Wed, 21 May 2014 05:28:00 -0700 (PDT) In-Reply-To: <2ABC1954-90FF-41CF-AB18-0C228A51CB8E@my.bristol.ac.uk> References: <762DAB52-9D2E-4002-80B0-526258DD7856@my.bristol.ac.uk> <2ABC1954-90FF-41CF-AB18-0C228A51CB8E@my.bristol.ac.uk> Date: Wed, 21 May 2014 13:28:00 +0100 Message-ID: From: David House To: Ollie Frolovs Cc: caml users Content-Type: multipart/alternative; boundary=047d7b66f74b89a4e604f9e820a8 Subject: Re: [Caml-list] Random.self_init in Jane Street Core --047d7b66f74b89a4e604f9e820a8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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); On 21 May 2014 13:25, Ollie Frolovs wr= ote: > 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 =E2=80=9Calias=E2=80=9D to Random.self_init was assigned to nothing, = so to speak, > instead of calling the function. > > Many thanks, Dmitry! I=E2=80=99ve amended that line to let () =3D Random.= self_init > () and it works. > > On 21 May 2014, at 13:18, Dmitry Grebeniuk wrote: > > > Hello. > > > >> let _ =3D Random.self_init > > > > That's why I almost never use "let _ =3D ...", or > > constrain "_" to some type when I use it. > > Try to replace it with "let () =3D ..." and follow compiler > > errors. Or with "let (_ : unit) =3D ...". > > > -- > 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 > --047d7b66f74b89a4e604f9e820a8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Relatedly, one should be careful using the [ignore] functi= on. Always give its argument a type signature. E.g. if you do this:
=C2=A0 ignore (my_function foo);

Then = this will start silently not calling [my_function] whenever someone adds a = second argument. You should instead use:

=C2=A0 ignore (my_function foo : Foo.t);


On 21 May 2014 1= 3:25, Ollie Frolovs <ollie.frolovs.2012@my.bristol.ac.uk= > 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 =E2=80=9Calias=E2=80=9D to Random.self_init= was assigned to nothing, so to speak, instead of calling the function.

Many thanks, Dmitry! I=E2=80=99ve amended that line to let () =3D Random.se= lf_init () and it works.

On 21 May 2014, at 13:18, Dmitry Grebeniuk <gdsfh1@gmail.com> wrote:

> Hello.
>
>> let _ =3D Random.self_init
>
> =C2=A0That's why I almost never use "let _ =3D ...", or<= br> > constrain "_" to some type when I use it.
> =C2=A0Try to replace it with "let () =3D ..." and follow com= piler
> errors. =C2=A0Or with "let (_ : unit) =3D ...".


--
Caml-list mailing list. =C2=A0Subscription management and archives:
ht= tps://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
--047d7b66f74b89a4e604f9e820a8--