From: Richard Jones <[email protected]> > It would be so nice to have a macro tool which was aware of types, but > that tool isn't camlp4. There are probably theoretical problems with > this, but having a "give_me_the_type_of (ocaml_subexpression)" > function would be awesome indeed.
The trouble here is that the type of the subexpression depends on its context... so that you would need to have already typed the whole expression to do that. If you are extending the syntax, this is a rather strong requirement. On the other hand, if you design your extension so that the program is typable before transforming it, then it would not be theoretically impossible to have campl4 read the dumped types and use them for an extra pass. You would still need to type everything once more after that for safety. Jacques Garrigue _______________________________________________ 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
