On 12/08/2011 03:33 AM, Edgar Friendly wrote:
On 12/07/2011 10:28 AM, Jérémie Dimino wrote:
Hi,
I have made a patch for ocaml 3.12.1 which allow to have a generic
printing function. The patch is available here:
external show : 'a -> string = "%show"
Of course it is limited to what the compiler knows, for example the
following function will always returns "[<poly>;<poly>]":
I'm interested in having compile-time reflection like this, but maybe
with a bit more generality.
You might be interested in my proposal to extend OCaml with a notion of
runtime representation of types:
http://www.lexifi.com/blog/runtime-types
A generic value pretty-printer can be written in "user-land" using this
extension (in a type-safe way).
-- Alain
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs