Hi, I guess you would want to map between a union in C and a datatype in ML. That would require the union type to contain sufficient information to allow the conversion process to know which variant of the datatype to use, which isn't necessarily true of a C union. You might be able to adapt the list example in polyml/mlsource/extra/CInterface/Examples/ForeignTest.sml. The type in C isn't exactly a union but you could have different STRUCTn for each variant.
I feel sure someone has a better example.
Regards, David
On 20/08/2012 07:51, Pierre-Alain Bourdil wrote:
Hi,
i'm looking for an easy way to map CType union. By easy way i mean, either a Conversion or a make_union/break_union. Having a look at the source code of CInterface, i see that conversion are managed by a union signature so i guess there's a way. But is there a solution that already exists ?
Regards, Pierre-Alain _______________________________________________ polyml mailing list polyml@inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml