If you know the type of this string in advance, you can do so with ocaml_plugin: https://github.com/janestreet/ocaml_plugin On Sun, Feb 23, 2014 at 8:23 PM, Matej Kosik < 5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote: > Hi, > > I would like to ask, what is the easiest way how to: > - take given string, provided by the user at run time > - run it through lexer --> parser --> check given value, in the current > context, has a given type > - and bind the value to a variable (provided there were no > lexing/parsing/typechecking problems). > > (I am not yet 100% sure, that this is the right direction to solve my > problem, but I am quite interested whether I could solve it this way.) > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >