From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 D92E47EEEF for ; Mon, 22 Jun 2015 15:52:36 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of ivg@ieee.org) identity=pra; client-ip=209.85.215.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of ivg@ieee.org designates 209.85.215.44 as permitted sender) identity=mailfrom; client-ip=209.85.215.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; 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@mail-la0-f44.google.com) identity=helo; client-ip=209.85.215.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="postmaster@mail-la0-f44.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CeAQD3EYhVlCzXVdFcg2RfBoMYqEQGlBKFdgKBLQdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBAwESEVYFCwsEBzcCAiISAQUBHAYTIogFCA2nIj4xiz+WDgEBAQEGAQEBAQEdCoYRhSqFBgeCaIFDBZN9hFaGeIF7lGwSI4EVF4QkIjGCSAEBAQ X-IPAS-Result: A0CeAQD3EYhVlCzXVdFcg2RfBoMYqEQGlBKFdgKBLQdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBAwESEVYFCwsEBzcCAiISAQUBHAYTIogFCA2nIj4xiz+WDgEBAQEGAQEBAQEdCoYRhSqFBgeCaIFDBZN9hFaGeIF7lGwSI4EVF4QkIjGCSAEBAQ X-IronPort-AV: E=Sophos;i="5.13,659,1427752800"; d="scan'208";a="137339872" Received: from mail-la0-f44.google.com ([209.85.215.44]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 22 Jun 2015 15:52:35 +0200 Received: by lagi2 with SMTP id i2so20719451lag.2 for ; Mon, 22 Jun 2015 06:52:35 -0700 (PDT) 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=idEALLQAv6sxJ7UGfZf7yOEPEb2AARMRZR8cvL9s0Jk=; b=dbtrTKAu4vD6AKdA+Nqp+KQe4xRlrLhQDy+Emqeha1Q0RwMCFfNrtL2gZ6L6cvsJgF GfGKMwP+hLW5aXWZXYOUINHG4n19NXototht4bQSLnbOO7Zxh1Unm4Vk2pdTY7v4mpM2 brKXeYgBIB2DpwSTNY7p86PKnZ6XEOs5dTk+8aamozmRGNhXzEIDxjts/yBlgyCPLMY4 xS8HBsOKmdjgbSWijxxMuqcpgQScVxlU5CZZiz0pjl+cMaBKLWuBKwt6rC90GFqgYklz 3wVWZSy4aoTRTcmbsU2QCVep+oJ3itLQRCjQwTTZK2T0ZzlCwyBHIYVtGDV4T3E1eUR/ zMvw== X-Gm-Message-State: ALoCoQksZAntMaMksqvdDGUwnpIA8oD9IvGW94c+LcgtgoYerTHbok0oxffY7hzaIvy8pPg2Rz+Z MIME-Version: 1.0 X-Received: by 10.152.206.75 with SMTP id lm11mr29587441lac.41.1434981154962; Mon, 22 Jun 2015 06:52:34 -0700 (PDT) Received: by 10.114.26.99 with HTTP; Mon, 22 Jun 2015 06:52:34 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Jun 2015 09:52:34 -0400 Message-ID: From: Ivan Gotovchits To: Alan Schmitt Cc: OCaml Mailing List Content-Type: multipart/alternative; boundary=001a1133bdc6005c8705191b960e Subject: Re: [Caml-list] use of ";;" when teaching Ocaml --001a1133bdc6005c8705191b960e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To my experience, this is a bad practice, that produces lots of confusion to students. They should clearly understand difference between writing code in a toplevel and normal programming. A difference between definition on a module level, and an expression. I usually say that `;;` is not a part of a language, but just a part of a toplevel command syntax (as well as toplevel directives), and strictly require not to put `;;` in code. On Mon, Jun 22, 2015 at 9:31 AM, Alan Schmitt < alan.schmitt@polytechnique.org> 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#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. > > 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 > > -- > OpenPGP Key ID : 040D0A3B4ED2E5C7 > Weekly CO=E2=82=82 average (2015-05-30, Mauna Loa Observatory): 403.41 ppm > --001a1133bdc6005c8705191b960e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
To my experience, this is a bad practice, that produces lo= ts of confusion to students.=C2=A0
They should clearly understand diffe= rence between writing code in a toplevel and normal programming. A differen= ce between=C2=A0
definition on a module level, and an expression.= I usually say that `;;` is not a part of a language, but just a part of a = toplevel
command syntax (as well as toplevel directives), and str= ictly require not to put `;;` in code.

On Mon, Jun 22, 2015 at 9:31 AM, Alan Schm= itt <alan.schmitt@polytechnique.org> wrote:
=
Hello,

In my Ocaml class, I tend to promote the use of ";;" to separate = phrases
(I'm basically following
http://ocaml.or= g/learn/tutorials/structure_of_ocaml_programs.html#Usingandomittingand<= br> 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

--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Weekly CO=E2=82=82 average (2015-05-30, Mauna Loa Observatory): 403.41 ppm<= br>

--001a1133bdc6005c8705191b960e--