[gambit-list] tell ___BOOL to be bool?

Mikael mikael.rcv at gmail.com
Wed Feb 1 04:19:56 EST 2012


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

2012/2/1 REPLeffect <repleffect at gmail.com>

> 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 at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20120201/b1434d01/attachment.htm>


More information about the Gambit-list mailing list