From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 385B97EEEF for ; Mon, 22 Jun 2015 15:53:28 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniil@baturin.org) identity=pra; client-ip=46.253.202.162; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniil@baturin.org"; x-sender="daniil@baturin.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of daniil@baturin.org designates 46.253.202.162 as permitted sender) identity=mailfrom; client-ip=46.253.202.162; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniil@baturin.org"; x-sender="daniil@baturin.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@srv-se.enfan.org) identity=helo; client-ip=46.253.202.162; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniil@baturin.org"; x-sender="postmaster@srv-se.enfan.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C4BgDcEohV/6LK/S5cgmYqVBVKgx68UQyFdgIIgSxMAQEBAQEBgQuEIwEBBCMdAQE2Ag8LGAICBRYLAgIJAwIBAgFFEwgBARWIFwMJsm1whGQBBZElDAEZBoEhiiSEUzoWGoF9DC8SgTGMf4cDhFaIc5Y2JoIKHYFcZYJIAQEB X-IPAS-Result: A0C4BgDcEohV/6LK/S5cgmYqVBVKgx68UQyFdgIIgSxMAQEBAQEBgQuEIwEBBCMdAQE2Ag8LGAICBRYLAgIJAwIBAgFFEwgBARWIFwMJsm1whGQBBZElDAEZBoEhiiSEUzoWGoF9DC8SgTGMf4cDhFaIc5Y2JoIKHYFcZYJIAQEB X-IronPort-AV: E=Sophos;i="5.13,659,1427752800"; d="scan'208";a="166654945" Received: from srv-se.enfan.org ([46.253.202.162]) by mail2-smtp-roc.national.inria.fr with ESMTP; 22 Jun 2015 15:53:27 +0200 Received: from eirin.enfan.tld (unknown [IPv6:2a02:2210:db:1:ca2a:14ff:fe56:458]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by srv-se.enfan.org (Postfix) with ESMTPSA id 186D71284AF for ; Mon, 22 Jun 2015 19:53:25 +0600 (NOVT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baturin.org; s=default; t=1434981206; bh=uC9Nao6IFVTXjlwiHQ0ZuyLBCXMWHC7kHc0+A8CbgZQ=; h=Date:From:To:Subject:References:In-Reply-To; b=dd6fqcj+2b40kKu9i2HJLJ4hFczvYB4dwlgdDO+2OaHPp2zvfYJl0iPPK+LWWMlOW g0+UGdhjAw7CxOtpUE4WL68j0NT7xObxVO/wwRm1ewgYlLoE1sR+pCvqV0V5YKBlEM g5TjLEGTkS25CugAO/M2RAB5RkDnFJgqMybD2rE4= Message-ID: <55881353.8060801@baturin.org> Date: Mon, 22 Jun 2015 19:53:23 +0600 From: Daniil Baturin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] use of ";;" when teaching Ocaml -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Alan, Since it's never necessary in the source code, I think it's a bad practice to use it. Also, since it's uncommon in real-life code, I think it will only cause more confusion in a long run. Besides, top level pattern matching adds more safety and expressivity. From let () =3D some_func x y z it's clear that some_func is called solely for its side effects, and the compiler will throw a type error if expression "some_func x y z" doesn't have type unit. Also, I rarely type the ;; after every phrase in the REPL, I like the ability to type or paste longer chunks of code and process them at once. On 06/22/2015 07:31 PM, Alan Schmitt wrote: > Hello, > > In my Ocaml class, I tend to promote the use of ";;" to separate phrases > (I'm basically following > http://ocaml.org/learn/tutorials/structure_of_ocaml_programs.html#Usingando= mittingand > although I was not aware of this page when I created the course). My > motivation is to minimize the difference between using the top-level and > writing files. > > I am now wondering if this is a good practice. In a nutshell, would you > rather use > > #+begin_src ocaml > let x =3D 12;; > print_endline "Hello World!" > #+end_src > > or > > #+begin_src ocaml > let x =3D 12 > let () =3D print_endline "Hello World!" > #+end_src > > when teaching Ocaml? > > Thanks, > > Alan > - --=20 #!/usr/bin/env perl @a=3Dsplit(//, "daniil @ baturin . org" );# Daniil Baturin @b=3Dsplit(//,q/Px%!+o0Q6lh*7dp$.@8#%|y{/);while($i<24){$_.=3D chr((ord(@b[$i])-ord(@a[$i])+62)%94+32);$i++};print"$_\n"# -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJViBNTAAoJEEcm35UR4K8fx7EP/0hdXT0zt2qg4xUmGq3ibQwi BMxh8ZKNBcKADAX7WuZxc/Os2FgemA51tl+hP2Jug+msx70rPjUKCLr02qR4iVPO NVJWZLWKM69NevHasBvaXGWuo2nTaV3N8Sk7KNi1Lt68IlKPbA3oOLYGHFGWs/Sz 4lCdPAx5ySV27mBFWi3bBJzkjZUwZVV5OAazHilTf08YBJAAnfHl3cq82ha/YxyD hwK5ObB2MDkMZ3OTwyQVbPloAtS9nQvmg3bKAcV8mFGmggUifaNLYXCjewKP0NZd bR/2UpBc8fRc7NNGLzC4CTFEJQQlBVActgIdY+UKbkKJdVQ26nBnxluxOgsFvXu/ ilwbvgCWCzi/I0XLyfFE3e0eHM4RMB+Oci+y44JrNJ/dYwAPxPVhkXwKRx6QuoFF OEtjxexWaRCJv1A0TvCfMTZS9G5zrfxtYFKwy+erhnUvZ8ozBZe2akrfYfch1oY6 0uFBE2FXO33WdySyu3W4xpfBhk6760LzioZdVTlOikwgKArsUCTCmTlQ0OOsSa8/ 2tehYTq+Lw6bwdEaUt/7VabOGPcAy7u2JNuT402Ol9xy64PdnVMCkmux45xGIznm twj5ZNEWldHna0x8us0H4cOIDLu33Ubu3Eq/1PFgx8gvcYa4CCIe4AyDm9vzXBP9 WeiWtzuTVh48l0+oe0rK =3DKU/e -----END PGP SIGNATURE-----