On Sun, Oct 31, 2010 at 4:08 PM, Sylvain Le Gall <sylv...@le-gall.net> wrote: > > Function names and values are "low id" in OCaml (first letter must be > uncapitalized). If you try to define "let MyConstr = 0" in an OCaml > toplevel, you will get a syntax error...
In unmodified toplevel, but the whole point is to use camlp4 (or camlp5). > The code generated by camlp4 must be syntactically correct. No, camlp4 generates syntax trees (i.e. they don't have syntax other than abstract syntax). (But if there are any asserts in OCaml source that an AST element called a lower case identifier is actually lower case, that could be a problem.) > But maybe you are talking about a deeper integration? One possibility would be to translate any "Constr" into a value in contexts where it cannot be parsed as applied to a value, and as constructor where it is applied to a value... It wouldn't be directly partially applicable, but it would serve most purposes since it would work as a function when passed to higher order functions as fold (and also could be easily rebound). _______________________________________________ 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