News for hackers. Stuff that matters.
Re:OCamlEditor by tomp on Tuesday November 25, 2014 @12:12PM (#8658557)
This is an nice example I put together about the ambiguous syntax:

  if a > 0 then
    print_endline "a > 0" ;
    match a with
      | 0 -> print_endline "impossible"
      | 2 ->
        match b with
          | 0 -> print_endline "2, 0"
          | _ -> print_endline "2, not 0"
      | 3 -> print_endline "3, something"
      | _ -> print_endline "something, something"
  ;
  print_endline "done"
You can see the rest of the discussion here: https://news.ycombinator.com/item?id=8497740

OPAM saves lives, that's true, but one still wishes there was a nice library of standard data structures; I use Batteries, which inherit the inconsistency of the standard library (for the sake of compatibility), the other real alternative is Core, which is undocumented.

Re:OCamlEditor by mercurial on Tuesday November 25, 2014 @01:09PM (#8658822)
I agree about the standard data structures, but there is no getting around the fact that it's not going to happen. You could have a look at Containers[1] if you want a break from Batteries.

1: https://github.com/c-cube/ocaml-containers

Re:OCamlEditor by yodsanklai on Tuesday November 25, 2014 @01:09PM (#8658825)
I don't see it as a problem. This type of imbricated "match" is so common that you learn pretty fast to always use parenthesis. Also, it's often a good idea to try to match (a,b) instead.
Re:OCamlEditor by eta_expand on Tuesday November 25, 2014 @03:27PM (#8659514)
In that particular example, the only misleading things are the indentation, and the lack of block delimiting for the inner match. The language grammar is accepted by the grammar compiler bundled with OCaml, which doesn't like ambiguous grammars.
Re:OCamlEditor by gnuvince on Tuesday November 25, 2014 @02:08PM (#8659119)
Not to be that technically-anal guy, but the syntax of OCaml is not ambiguous from a CS point-of-view. However, it does have rules that can be counter-intuitive to humans.