If your set of symbol is closed, you can use a variant type (sum type).

type symbols =
| A
| B


If you really need open symbols, you can use [polymorphic variants].

Let tag_a foo = (`A, foo)

 [polymorphic variants]
http://caml.inria.fr/pub/docs/manual-ocaml/manual006.html#toc36


However, you won't have convenience functions such as string_of_symbol; you
would have to define them yourself.
_______________________________________________
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

Reply via email to