On 20/08/2012 15:28, Pierre-Alain Bourdil wrote:
In ForeignTest, the vol2tree method use fromClong to differentiate between NullTree, or Tree. My union, is made of 2 variants : a struct pointer and a int64_t . I can't figure out how to decide if a given vol is a pointer or an int64_t. is there a solution ? The inverse conversion is pretty forward
It's difficult to know what to do if you can't tell whether you have a number or the pointer to something. Are you actually returning these sort of values from your C code to ML? If not you can just use a dummy function that raises an exception in the conversion from a vol to the ML datatype.
David