On Tue, Jun 23, 2015 at 9:27 AM, Alan Schmitt < alan.schmitt@polytechnique.org> wrote: > Hello, > > Thanks to everyone for your answers, this has given me much food for > thought. > > On 2015-06-23 01:41, Philippe Wang writes: > > > 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. > > I like this approach because it amounts to saying "one always starts > a phrase with 'let' or 'type'" (and later in the year there can be > 'open', 'module', 'include'). I sure can live without top-level > expressions. > > On the other hand, I also like the idea of terminating phrases, simply > because explaining when it terminates is not trivial otherwise, as > a 'let' may not be the beginning of a phrase. > > > 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. > > I am curious about this. My goal is to teach the language, and I find > that a REPL backed with a file works great to do this (using tuareg or > ocaml-top). What do you use to make sure students have a fast > compile/debug cycle? > You should take a look into ocaml-top [1]. It is a toplevel that doesn't require `;;` at all. > > Thanks again, > > Alan > > -- > OpenPGP Key ID : 040D0A3B4ED2E5C7 > Weekly CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm >