Probably this won't work out as Gambit has fixed integer values set to the values true and false that need to be this way
Though, there is some macro that equals (eq? #t v) that you could use for your interconversion, and equally you can make a routine something like SCMOBJ toBool(bool b) { return b ? ___TRUE : ___FALSE; } no?
In all cases the C ffi can do this autoconversion for you (for arguments/return values you declared as bool).
If you get to any nice solution on this one please let the ml know. :)
Btw, something I'd appreciate much to see documented on the wiki would be a complete reference on how to traverse and construct Scheme structures from C. So like, how do cdr, car, null?, cons, vector-ref, boolean values, fixnums etc.
Kind regards, Mikael
Would it be possible to get a configure option that will allow ___BOOL
to be defined as bool instead of int? I understand at least some of
the reasons behind defining it as int for compatibility with some
compilers. It would just be nice to be able to chose to have it be
bool instead.
Perhaps there are ramifications which I have not considered. But it
makes it nice for interfacing with my C++ code to have ___BOOL
actually be bool (unless, of course, unconsidered ramifications would
have detrimental effects on me -- in which case, please feel free to
enlighten me) :-D
_______________________________________________
Gambit-list mailing list
Gambit-list@iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list