From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 8BBE37EEEF for ; Tue, 23 Jun 2015 01:42:09 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of philippe.wang.lists@gmail.com) identity=pra; client-ip=209.85.160.181; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="philippe.wang.lists@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of philippe.wang.lists@gmail.com designates 209.85.160.181 as permitted sender) identity=mailfrom; client-ip=209.85.160.181; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="philippe.wang.lists@gmail.com"; 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-yk0-f181.google.com) identity=helo; client-ip=209.85.160.181; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="postmaster@mail-yk0-f181.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CcAQDanIhVlLWgVdFcg2RfBoMYvGKHMgdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBBBIRHQErDQEDDAEFBQsNAgImAgIiEgEFARwGEyKHeAMSDahfPjGLP4Rki0knDYVtJgEFDoETiiSELYNIgUMFk31KhAyGeIE6QZJbghESI4EVF0mDQTwxgQOBRQEBAQ X-IPAS-Result: A0CcAQDanIhVlLWgVdFcg2RfBoMYvGKHMgdMAQEBAQEBEgEBAQEHCwsJHzCEIwEBBBIRHQErDQEDDAEFBQsNAgImAgIiEgEFARwGEyKHeAMSDahfPjGLP4Rki0knDYVtJgEFDoETiiSELYNIgUMFk31KhAyGeIE6QZJbghESI4EVF0mDQTwxgQOBRQEBAQ X-IronPort-AV: E=Sophos;i="5.13,662,1427752800"; d="scan'208";a="137400543" Received: from mail-yk0-f181.google.com ([209.85.160.181]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Jun 2015 01:41:46 +0200 Received: by ykdr198 with SMTP id r198so139867020ykd.3 for ; Mon, 22 Jun 2015 16:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Xx43o/k3cyr0whUXJ/KjBvn+l0mW8pelxQ54Vj0fy6U=; b=nZLXsWfsggh05w4N/z8R3Q1zTETza4dVxN92PUm+Np8QCzOiZCUUHUFxHyifsg9MBg oekdN/VOaicDcPtucI8W9MTRWF/pwGH9CCbUN0SqGxqQCd1kZMSFncMNo2/4g6o4wDUt brgRMDhss8RVQ4w8fwhq8AUOfLJAf9UkHeawTGVYayYC8sOZIe8RWOEy1e9Yij15MRfs NDlKfyPFs0bARvxmblcadO07SxKlqUrds7i9EDfGYs56J2PwaZ/jMSYHkohbr7wMVh56 6bVPpuLIl+nwE5EVbEvWGbMCgoI3kwbat0Pzk4Gf5afTU++jjaGvybrkhpHFjhPZ/5ge rxyg== MIME-Version: 1.0 X-Received: by 10.170.218.86 with SMTP id k83mr39427736ykf.6.1435016505396; Mon, 22 Jun 2015 16:41:45 -0700 (PDT) Sender: philippe.wang.lists@gmail.com Received: by 10.37.203.135 with HTTP; Mon, 22 Jun 2015 16:41:45 -0700 (PDT) In-Reply-To: References: Date: Tue, 23 Jun 2015 01:41:45 +0200 X-Google-Sender-Auth: lpvVxLD-DCgdzX9DqCiPHzIhmm0 Message-ID: From: Philippe Wang To: Alan Schmitt Cc: OCaml Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] use of ";;" when teaching Ocaml In my opinion, it's a lot more relevant to use a very limited and very simple subset of OCaml when teaching to beginners. And this subset does not involve expressions at top-level because it's not worth the trouble. Writing `42;;` or `print_string "hello";;` does not help: in the best case scenario, it won't be confusing, but for most people, it will be one more thing to understand, and there are so many things that are more interesting to understand. Also, using the interactive top-level loop is, in my opinion, not good for beginners. It should only be presented to those who already understand very well the "core" of OCaml. The most frequent issue with the top-level loop is that it gets in the way of the notion of compiling a program, and it might give the false impression that OCaml can be interpreted. Well, if all your student are exceptionally intelligent, forget what I'm saying. My experience, as someone who has taught OCaml to L2/L3/M1/M2 students (at University Paris 6), is mostly based on teaching to very various students, all sorts from extremely idiotic to extremely smart, so I prefer to make every one's work as gainful as possible, with as little superfluous concepts (including advanced topics that don't look like advanced topics to people who are very used to using OCaml) as I possibly can. On the other hand, if your students are not exceptionally smart, I really believe you should act as ;; simply didn't exist in OCaml (the smartest ones will discover ;; by themselves, or you might want to show it just to them, and learn to use it efficiently by themselves too). Philippe Wang On Mon, Jun 22, 2015 at 3: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#Usingandomittingand > 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 = 12;; > print_endline "Hello World!" > #+end_src > > or > > #+begin_src ocaml > let x = 12 > let () = print_endline "Hello World!" > #+end_src > > when teaching Ocaml? > > Thanks, > > Alan >