On Sat, 26 Apr 2008 09:41:57 +0200, Richard Jones <[EMAIL PROTECTED]> wrote:

I'm guessing that there will be ambiguity because you're wanting to
add yet another meaning to the reserved word 'in'.

However I'm not sure why you don't just use 'List.mem', or even:

  let mem = List.mem ;;

  mem 1 [1;2;3]

Since I am reading the "Haskell School of expressions" right now (to become better at functional Programming, not to leave my favourite language :)) I am starting to like the way you can turn any function into an infix operator by using quotes. Wouldn't it be possible to have something similar to this in OCaml? I don't think there is an easy way to do this yet, since I didn't find anything on this topic.

I am posting this in this thread, because this would allow us to write the above more elegantly as:
1 `mem` [1;2;3], which is close to what was originally proposed.

What do you think of this?

bye,
  Till


--
There once was a man from the sticks
Who liked to compose limericks.
But he failed at the sport,
For he wrote 'em too short.

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to