[gambit-list] check vs null
Marc Feeley
feeley at iro.umontreal.ca
Sat Feb 14 18:26:46 EST 2009
On 14-Feb-09, at 5:32 PM, lowly coder wrote:
> it works now; thanks!
>
> the main reason I posted to gambit rather than #scheme ... is that
> this seems a C-FFI (thus implementation specific question, not a
> generic scheme question)
>
> if I'm wrong ... please point out what scheme standard defines how
> NULLS from C-FFI/land is handled in scheme?
If you define get-foo this way
(define get-foo (c-lambda () (pointer foo) "get_foo"))
then the C NULL maps to the Scheme #f. On the other hand, if you want
to exclude the possibility that the pointer is NULL then define it
this way
(define get-foo (c-lambda () (nonnull-pointer foo) "get_foo"))
These are Gambit specific things.
Marc
More information about the Gambit-list
mailing list