On 05/01/2016 11:45, Phil Clayton wrote:
Another observation for future consideration: there is no conversion for the boolean type. I believe that the existing CInterface.BOOL is a convenience for an int treated as a boolean (indicating a non-zero value) and can easily be created as a derived conversion. It's worth noting that C99 has a type "_Bool" (with a macro to refer to it as "bool") that "is large enough to store the values 0 and 1". Depending on the platform, I believe that sizeof(_Bool) could be larger than one byte, so it could be useful to have a conversion for the _Bool type.
At the lowest level the Poly/ML conversions make use of LibFFI types to provide size and alignment information. There's no "bool" type there and I would guess that this is because there's no consensus about exactly what it should be in C, at least historically.
David