Re:Cello – Higher Level Programming in C
by AnimalMuppet on Friday December 26, 2014 @02:35PM
(#8799988)
Converting a C value to a Cello value is easy.
int cValue = 5; // because I randomly feel like that's a good number
var celloValue = $(Int, cValue); // I'm pretty sure this works, but I haven't proven it
Coming back from Cello to C, it appears that you can do this: long anotherCValue = as_long(celloValue);
I would love to use this library but as C programs often requires third-party libraries I could see many instances of having to use normal C types. Is there a way, for example, to easily convert a float to and from a var (with a Real key/value)? How would I use your library to take hash table values and assign them back into standard struct members? Would I just use traditional casting? Something tells me normal casting is not an option, or at least not so easy.