Aware that this belongs to beginners-list, I first posted there
three weeks ago, but without any answer :
I bet this kind of code should be rather common :
let string_of_piece_type = function
King -> "King"
| Queen -> "Queen"
| Rook -> "Rook"
| Bishop -> "Bishop"
| Knight -> "Knight"
| Pawn -> "Pawn"
Please have you got an example where the macro helps to implement such kind of "string_of_type" function ?
Thanks,
Fabrice
_______________________________________________
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
You probably want to look at deriving (http://code.google.com/p/deriving/)
or tywith (http://www.seedwiki.com/wiki/shifting_focus/tywith) which
can generate these functions automatically.
Rich.
--
Richard Jones
Red Hat