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 03BD97EEEF for ; Mon, 22 Jun 2015 16:19:35 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.131; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.131; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=212.227.126.131; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BfAQC2GIhVlIN+49Rcg2RftVyKFAyFdgKBNUwBAQEBAQESAQEBAQcLCwkfMIQjAQEDAVUkBQsLRlcGEwmFdIIqDAnJbgEBAQEBAQQBAQEBHotFhGAmB4ItDEGBMQWHA4x6aAKDbIZ4gXuGNAOPf4QhbQGCRwEBAQ X-IPAS-Result: A0BfAQC2GIhVlIN+49Rcg2RftVyKFAyFdgKBNUwBAQEBAQESAQEBAQcLCwkfMIQjAQEDAVUkBQsLRlcGEwmFdIIqDAnJbgEBAQEBAQQBAQEBHotFhGAmB4ItDEGBMQWHA4x6aAKDbIZ4gXuGNAOPf4QhbQGCRwEBAQ X-IronPort-AV: E=Sophos;i="5.13,659,1427752800"; d="asc'?scan'208";a="166660769" Received: from mout.kundenserver.de ([212.227.126.131]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jun 2015 16:19:34 +0200 Received: from office1.lan.sumadev.de ([84.59.134.104]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0Lodqd-1YaysA1viN-00gpiz; Mon, 22 Jun 2015 16:19:33 +0200 Received: from [192.168.65.10] (unknown [192.168.65.10]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id BD338DC05D; Mon, 22 Jun 2015 16:19:32 +0200 (CEST) Message-ID: <1434982765.31996.19.camel@e130.lan.sumadev.de> From: Gerd Stolpmann To: Alan Schmitt Cc: OCaml Mailing List Date: Mon, 22 Jun 2015 16:19:25 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-6q5e3y81WkdYLzaEyP4v" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Provags-ID: V03:K0:/OB3YLFgKwim+J5YJKhptlTMl88zt8zZeLv/Qim8Dx6ySPetlSJ k4FS03d8ia5KF1bW6jBokbWA9ZUzTu5z1Bv/Onc5qpvGy0qThLt6CT46TFeBmsAigacX06a n8+EdnT89A9fLYI+2XVEHo4yS24rL5UKIs6nWwnDyJfFtxd+NDKrYIIpF4Zjj/K7XmrEUK5 T+eYHiSiH04FUqX//4gHA== X-UI-Out-Filterresults: notjunk:1;V01:K0:fUHorAOC7SE=:XQJ9KfkJQW0g/TFJzXeTS9 y0WInm0L3A3iWNSg4rrs/rYR7qpcF24ZPqX6iIHss4pKCtZRU3ggOv5wXPMQVemRHLyhSV1q2 JaY2gsSToUE0anZaLKkdhfz1jmt6nKsceLvdFfgPL5WJ3yJq+3jzMtYui6I7DZmAVZuVeuu3g fVEdGq2n+6aADz4ZGjTYJQU86a25ZG2/kz8lTGt/DNBT43kZyrdGW+kzN6s7I3oyrqm0ibrrk 8Wg1B4aWXzk6uI+SYymM4VCIEM9Z9y+EaZYngT35aZlB7ZNfcdYzNpWWk+GJk0nEiGUUN5tL2 sDsL24n4dz0OVBtTyfQHABy+I2kPwseRavm8+aCMbo/zC4AZihsXGkbUq4xph17PZxnP7n02+ aHqNY09DTdjUu2tmnnQ2qcP3IBgenYUEiC5FXkwPhYeoFQ2aCaxnO79ow/hGRkPYt5ceFeS75 +dxIMdvjQg/BRc/h8/nTFhLae3SbiN26yPDyjRLEO7JALObc4ZUcuRWHSYrizsqWXmfswHeCD KbXVVNPL06Xj5qDw9jxJGjnraoVUj8OO3e4totq4d3xr1wYozA+Ws6oIXr+hmLnCS45Kdgn6K BChJBJSPQTVY9eFEKptBahu1IrKIbNC8yH/3FshHazIQxhvoMyn378L/ChESzMogxWyzj88J2 TAXPFEm6bMWDUT6aoVvdqDmFq Subject: Re: [Caml-list] use of ";;" when teaching Ocaml --=-6q5e3y81WkdYLzaEyP4v Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable Am Montag, den 22.06.2015, 15:31 +0200 schrieb Alan Schmitt: > Hello, >=20 > 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#Usingan= domittingand > 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. >=20 > I am now wondering if this is a good practice. In a nutshell, would you > rather use >=20 > #+begin_src ocaml > let x =3D 12;; > print_endline "Hello World!" > #+end_src >=20 > or >=20 > #+begin_src ocaml > let x =3D 12 > let () =3D print_endline "Hello World!" > #+end_src >=20 > when teaching Ocaml? There is one downside of not using ";;", namely that you sometimes get syntax errors much later than necessary. E.g. in let x =3D=20 do_this(); do_that(); let y =3D 6 let z =3D do_third_thing() you get the syntax error at the position of the third "let" although it is the extra semicolon at the end of the first definition. This can be very confusing, and it is a very good reason to use ";;" outside the toplevel. IMHO it is better to be honest about this issue. Because "let" is an open-ended construction the ";;" can be useful as end marker, and the compiler emits better error messages with more precise locations. Gerd > Thanks, >=20 > Alan >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-6q5e3y81WkdYLzaEyP4v Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJViBltAAoJEAaM4b9ZLB5TEqwH/3tbvyw1eJwxg/qTCgoG8yQm Fx2QIE8VqkzrXeFsBSUhmpXIiQhBilyiTNYrqXNjjP7I0n2fhGyY+t2Pl/DXp7sA /cHYI3es5IcDiQEgCPvn7TMub3/npA3unu8YN/L1eQp3c6Vz798jZnTLPoyCTees +ng/dAAVOxopcI4XLESuADcs1LKTVG8VnaJBD2NcZmsr1qpWInMVPJsC2vA4WQSk EuElqMF5lFKbgY1/P7BSH3zWxDFaskALB7PbfH3LcSoTxGciHjVlA8wjgY/tFsUn MwKnFaShTvTecdAD7zjFV2S8zYB3M+t22uph+v6SH5qUJbOP/hVDoxMgFLE+2tI= =e0oc -----END PGP SIGNATURE----- --=-6q5e3y81WkdYLzaEyP4v--