News for hackers. Stuff that matters.
Re:Comparing OCaml and Standard ML by p4bl0 on Thursday October 23, 2014 @11:49AM (#8498795)

    if <expr1> then <expr2.1>;<expr2.2> else <expr3>
Actually, this will not work, I was also confused by it.

    # if true then (); 1 else 2;;
    Error: Parse error: [str_item] or ";;" expected (in [top_phrase])
    # if true then begin (); 1 end else 2;;
    - : int = 1
    # if true then ((); 1) else 2;;
    - : int = 1
The confusion comes from the fact that it doesn't behave the same way in match expressions:

    # match true with | true -> (); 1 | false -> 2;;
    - : int = 1

There are no comments on this comment yet.