it works now; thanks!<br><br>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)<br><br>if I'm wrong ... please point out what scheme standard defines how NULLS from C-FFI/land is handled in scheme?<br>
<br><div class="gmail_quote">On Sat, Feb 14, 2009 at 2:26 PM, Marijn Schouten (hkBst) <span dir="ltr"><<a href="mailto:hkBst@gentoo.org">hkBst@gentoo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div><div></div><div class="Wj3C7c"><br>
lowly coder wrote:<br>
> suppose I have c code of:<br>
><br>
> [1] foo *bar = get_foo();<br>
> [2] if (bar != NULL) { ... }<br>
><br>
><br>
><br>
> in scheme, I have<br>
><br>
> (let ((bar (get-foo))) [1]<br>
>   [2] <-- how do I write this line in scheme?<br>
<br>
</div></div>(if bar (do-something-with bar) (do-something-else))<br>
<br>
<br>
(get-foo) should evaluate to #f if there is no bar.<br>
<br>
You should give #scheme a try for such basic questions.<br>
<br>
Good luck,<br>
<br>
Marijn<br>
<br>
<br>
- --<br>
Sarcasm puts the iron in irony, cynicism the steel.<br>
<br>
Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML<br>
<<a href="http://www.gentoo.org/proj/en/lisp/" target="_blank">http://www.gentoo.org/proj/en/lisp/</a>>, #gentoo-{lisp,ml} on FreeNode<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.9 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
iEYEARECAAYFAkmXRSkACgkQp/VmCx0OL2xTLwCfQFdraxstZxU626l8wj7Fzmit<br>
MB0AoLkb48VNsPl3QZHdiKZqVIwG5aVy<br>
=s+QO<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br>