From: David House <dhouse@janestreet.com>
To: Thomas Refis <thomas.refis@gmail.com>
Cc: Gerd Stolpmann <info@gerd-stolpmann.de>,
Alan Schmitt <alan.schmitt@polytechnique.org>,
OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] use of ";;" when teaching Ocaml
Date: Mon, 22 Jun 2015 17:47:27 +0100 [thread overview]
Message-ID: <CAK=fH+h=uzS5v2GYjj4H59pr-xXEoKiZEqEZ7Ax2PuY_dvEcrg@mail.gmail.com> (raw)
In-Reply-To: <CAJ_epFOwRBHZmqejc20MhFrVAReSpvo=sm0fBkcF+Cn89cQiNQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]
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 <thomas.refis@gmail.com> wrote:
> 2015-06-22 15:19 GMT+01:00 Gerd Stolpmann <info@gerd-stolpmann.de>:
> > 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
>
[-- Attachment #2: Type: text/html, Size: 3179 bytes --]
next prev parent reply other threads:[~2015-06-22 16:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 13:31 Alan Schmitt
2015-06-22 13:52 ` Ivan Gotovchits
2015-06-22 13:53 ` Daniil Baturin
2015-06-22 14:19 ` Gerd Stolpmann
2015-06-22 15:48 ` Damien Doligez
2015-06-22 15:56 ` Thomas Refis
2015-06-22 16:07 ` Mark Shinwell
2015-06-22 16:30 ` Gerd Stolpmann
2015-06-22 16:47 ` Mark Shinwell
2015-06-22 17:08 ` Daniel Bünzli
2015-06-22 18:56 ` Gerd Stolpmann
2015-06-22 17:18 ` Török Edwin
2015-06-22 17:42 ` Francois Berenger
2015-06-22 17:46 ` Ivan Gotovchits
2015-06-22 17:53 ` John Whitington
2015-06-22 16:07 ` Pippijn van Steenhoven
2015-06-22 16:25 ` Daniel Bünzli
2015-06-22 18:18 ` Steve Zdancewic
2015-06-22 16:42 ` Thomas Refis
2015-06-22 16:47 ` David House [this message]
2015-06-22 17:08 ` Daniil Baturin
2015-06-22 17:04 ` Daniel Bünzli
2015-06-22 23:41 ` Philippe Wang
2015-06-23 1:15 ` Kenichi Asai
2015-06-23 13:27 ` Alan Schmitt
2015-06-23 13:35 ` Ivan Gotovchits
2015-06-23 13:36 ` Ivan Gotovchits
2015-06-25 16:51 ` Philippe Wang
2015-06-29 0:12 ` Philippe Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK=fH+h=uzS5v2GYjj4H59pr-xXEoKiZEqEZ7Ax2PuY_dvEcrg@mail.gmail.com' \
--to=dhouse@janestreet.com \
--cc=alan.schmitt@polytechnique.org \
--cc=caml-list@inria.fr \
--cc=info@gerd-stolpmann.de \
--cc=thomas.refis@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox