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 15CFC7EEEF for ; Mon, 22 Jun 2015 18:47:30 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.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=mail2-smtp-roc.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 (mail2-smtp-roc.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=mail2-smtp-roc.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: A0DdAQDyOohVnHDIaSZcg2RfBoMYq2qOWoIPAQmFeAKBMwdMAQEBAQEBEgEBAQEBBhYJT4QjAQEDAQ4EER0BASMJCwEECwsLGh0CAiEBEgEFAQoSBhMSEIVbgh0DCggDCqgQPjGKT3CEZAEFi0MDCoVbAQEBAQEBAQECAQEBAQEBAQEBARIGCos7gk2CNQQHgi0MLxKBMYVfCo4ZhFaFFwOBXoE6QY8egz2CERIjgRURBoQJboJIAQEB X-IPAS-Result: A0DdAQDyOohVnHDIaSZcg2RfBoMYq2qOWoIPAQmFeAKBMwdMAQEBAQEBEgEBAQEBBhYJT4QjAQEDAQ4EER0BASMJCwEECwsLGh0CAiEBEgEFAQoSBhMSEIVbgh0DCggDCqgQPjGKT3CEZAEFi0MDCoVbAQEBAQEBAQECAQEBAQEBAQEBARIGCos7gk2CNQQHgi0MLxKBMYVfCo4ZhFaFFwOBXoE6QY8egz2CERIjgRURBoQJboJIAQEB X-IronPort-AV: E=Sophos;i="5.13,660,1427752800"; d="scan'208";a="166690136" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 22 Jun 2015 18:47:29 +0200 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout1.mail.janestreet.com with smtp (Exim 4.82) (envelope-from ) id 1Z74sa-00085M-AC for caml-list@inria.fr; Mon, 22 Jun 2015 12:47:28 -0400 X-JS-Flow: external Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BViDwg-AAAHCK-Ja; 2015-06-22 12:47:28.301762-04:00 Received: from mail-qc0-f178.google.com ([209.85.216.178]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1Z74sa-00031O-6S for caml-list@inria.fr; Mon, 22 Jun 2015 12:47:28 -0400 Received: by qcbcf1 with SMTP id cf1so26522462qcb.0 for ; Mon, 22 Jun 2015 09:47:27 -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=WvytcMdTKiNqpAXhrm6uRck+8gFrAMnVEZMNtDwgiMk=; b=Z98P6KndikrmejRK9gHSd/PnkIC0AhvARNP+jRyaxY5haoh2llijG4GpUbgNn5XPXr PqPHW7hkGMCdbBpgRO9JiCUlnCTrybWPAOi1oM6fdhnexM/3FsUCiZeoRpj7BeJ0zSAN BrCx27PuHhOvRAYCPxYe1aD2tLTJ6ObDfqwRw= 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=WvytcMdTKiNqpAXhrm6uRck+8gFrAMnVEZMNtDwgiMk=; b=kxi9pJAvxJ+6vXz34eQrjLJ33GC/aInda0NI1njyZwxktgDCU6EtgFODKJrsUhRurY x7x9/a274767CBJRZeSxkkgzFhBUFeApn95pt+72O+5bLnYnllsFSaleAwpAgpE3dGwZ NxjQILSS+59rMT3Ayvf4FAYDB1B13q1gzNIXl7VFD4aGMlVr43t13a24zsxSLhzNYx3W bU6rXIc4FCbo+qCw553N+4vFOUs4Y/GSB9tKK9TXXbSXeM8se64pMGgKBWUSrKilvQW/ DB2KWkjPSmWbHuUOkjwwdqkLuVHW6QK/PyW6CIgp8PmG39OvaldvCJXl5/6wrNEAK6aJ tFxw== X-Gm-Message-State: ALoCoQnajTMg/ACewxmYEr/jn7rD7zLWIRpgv5Xq6KCOLWb10me2vsgnNhGgpZF3vXR0Y+1v4KUm3715kMZQ/MnO5UMC1oAJVUn4tnBur1lS2CkvlHdho4l2castPbXxCO/+SmcfOUC4 X-Received: by 10.55.22.130 with SMTP id 2mr64867466qkw.45.1434991647893; Mon, 22 Jun 2015 09:47:27 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.55.22.130 with SMTP id 2mr64867444qkw.45.1434991647778; Mon, 22 Jun 2015 09:47:27 -0700 (PDT) Received: by 10.140.107.102 with HTTP; Mon, 22 Jun 2015 09:47:27 -0700 (PDT) In-Reply-To: References: <1434982765.31996.19.camel@e130.lan.sumadev.de> Date: Mon, 22 Jun 2015 17:47:27 +0100 Message-ID: From:David House To:Thomas Refis Cc:Gerd Stolpmann , Alan Schmitt , OCaml Mailing List Content-Type: multipart/alternative; boundary=001a114917a26c313d05191e070f X-JS-Processed-by: mailcore Subject: Re: [Caml-list] use of ";;" when teaching Ocaml --001a114917a26c313d05191e070f Content-Type: text/plain; charset=UTF-8 That's true, although it's probably a little easier to spot a missing ;; than a non-missing trailing ;. I expect that on balance you'll have better errors more often with using ;;. So it seems sensible to use it for teaching beginners. Once you're an old hand like Mark Shinwell, you can make up your mind whether it's worth keeping it up or not ;) On 22 June 2015 at 17:42, Thomas Refis wrote: > 2015-06-22 15:19 GMT+01:00 Gerd Stolpmann : > > There is one downside of not using ";;", namely that you sometimes get > > syntax errors much later than necessary. E.g. in > > > > let x = > > do_this(); > > do_that(); > > let y = 6 > > let z = > > 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. > > The argument seems a bit weak. > The example is (if I understand correctly): "I have a trailing > semicolon which the compiler doesn't report properly but instead tells > me there is a syntax error in a completely unrelated place! If you > place double semicolons in your code, that doesn't happen!". > But it could also be understood as: "I usually place double > semicolons, but in this case I forgot. And the compiler doesn't report > this properly but instead tells me there is a syntax error in a > completely unrelated place!". > > You face the same problem either way, you still have to be "fluent" to > know where to look when you encounter this error. > And I'd guess a beginner is as likely to forget the ";;" as to leave a > trailing ";". > > -- > 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 > --001a114917a26c313d05191e070f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That's true, although it's probably a little easie= r to spot a missing ;; than a non-missing trailing ;.

I = expect that on balance you'll have better errors more often with using = ;;. So it seems sensible to use it for teaching beginners. Once you're = an old hand like Mark Shinwell, you can make up your mind whether it's = worth keeping it up or not ;)

On 22 June 2015 at 17:42, Thomas Refis <thoma= s.refis@gmail.com> wrote:
<= span class=3D"">2015-06-22 15:19 GMT+01:00 Gerd Stolpmann <info@gerd-stolpmann.de>:
> There is one downside of not using ";;", namely that you som= etimes get
> syntax errors much later than necessary. E.g. in
>
> let x =3D
>=C2=A0 =C2=A0do_this();
>=C2=A0 =C2=A0do_that();
> let y =3D 6
> let z =3D
>=C2=A0 =C2=A0do_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 ";;" out= side the
> toplevel. IMHO it is better to be honest about this issue. Because &qu= ot;let"
> is an open-ended construction the ";;" can be useful as end = marker, and
> the compiler emits better error messages with more precise locations.<= br>
The argument seems a bit weak.
The example is (if I understand correctly): "I have a trailing
semicolon which the compiler doesn't report properly but instead tells<= br> me there is a syntax error in a completely unrelated place! If you
place double semicolons in your code, that doesn't happen!".
But it could also be understood as: "I usually place double
semicolons, but in this case I forgot. And the compiler doesn't report<= br> this properly but instead tells me there is a syntax error in a
completely unrelated place!".

You face the same problem either way, you still have to be "fluent&quo= t; to
know where to look when you encounter this error.
And I'd guess a beginner is as likely to forget the ";;" as t= o leave a
trailing ";".

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--001a114917a26c313d05191e070f--