Version française
Home     About     Download     Resources     Contact us    
Browse thread
String representation of the expression: may camlp4 help?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitri Boulytchev <db@t...>
Subject: String representation of the expression: may camlp4 help?
    Hello everybody,

    I'm looking for the way to get string representation of the OCaml 
expression
    at compile-time to facilitate test writing. Consider an example:

         let repr, value = WITH_REPR (1+2) in
         Printf.printf "%s=%d" repr value

    Here WITH_REPR is a meta-construction that returns ("1+2", 3) (generally
    speaking WITH_REPR(c) whould return (string * type_of c)).

    Is there some convinient way to do this? May camlp4 help?

    Best regards,
    Dmitri Boulytchev,
    St.Petersburg State University