On Fri, Apr 25, 2008 at 01:37:47PM -0700, Arthur Chan wrote:
> Would it be difficult to have python-like syntax for List.exists?  Could we
> add it to Hashtbl and Array too?  I'm not too fond of python's general
> sloppiness, but the (x in mylist) syntax seemed very pretty to me.  At the
> least, it correspondes directly to mathematical syntax (x \in blah, for
> Latex ppl).
> 
> Does this already exist in a syntax extension?

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]

Did I miss something about how the Python syntax works?

Rich.

-- 
Richard Jones
Red Hat

_______________________________________________
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