1. I still don't understand what's going on. Any chance you could explain it in a little more detail? I'd love to start learning OCaml, but I've just never gotten around to it.
      posted by Bill Mill at 11:55:05 PM on November 15, 2004  
  2. I added an update to the post, that hopefully makes things a bit clearer.
      posted by Hans Nowak at 12:21:47 AM on November 16, 2004  
  3. Much nicer. The problem I was having understanding the code was that my mental parser just assumes that a line starting in '#' is a comment. I was having a very difficult time figuring things out while I assumed that the input lines were comments.

    Duh.
      posted by Bill Mill at 01:03:33 AM on November 16, 2004  
  4. They're not that different, I only need three extra characters to get OCaml semantics. ;)

    >>> def g(x,f=f): return f(f(x))
    ...
    >>> g(5)
    20
    >>> def f(x): return 3*x
    ...
    >>> g(5)
    20

      posted by Blake Winton at 07:49:19 PM on November 16, 2004  
  5. The # marks are the prompt for the ocaml toplevel interpreter.

    I've been learning OCaML as part of a comp. ling. course. Check out the course notes and examples here:

    http://www.msu.edu/course/lin/475/

    The course notes and examples are excellent if you're looking to learn OCaML.
      posted by Joshua Gerrish at 11:02:02 PM on November 16, 2004  
  6. """ They're not that different, I only need three extra characters to get OCaml semantics. ;)"""

    Hm, indeed. But can you make OCaml behave like Python? :-)
      posted by Hans Nowak at 11:20:04 PM on November 16, 2004