guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scm_defined_p(sym, env)


From: Andreas Rottmann
Subject: Re: scm_defined_p(sym, env)
Date: Tue, 23 Aug 2011 21:07:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Richard Shann <address@hidden> writes:

> I didn't find the SCM_UNBNDP() that you mention but since mailing the
> list I stumbled on SCM_UNDEFINED and tried 
> if(opt==SCM_UNDEFINED) ...
> and that seems to work. 
>
IIRC, that this works is not actually guaranteed (it depends on the type
of the SCM values; that type might not have defined/reasonable behavior
wrt. the "==" operator, so the right way to write the above comparison
would be `scm_is_eq(opt, SCM_UNDEFINED)', and incidentially, this is how
SCM_UNBNDP() is defined (see libguile/tags.h, at least on Guile 2.0).

> So (unless I am doing something bad) I think I am back on course -
> thanks!
>
The idiom you used may work for you now, but may be broken at any time,
or even when compiling Guile with a different configuration (search for
SCM_DEBUG_TYPING_STRICTNESS in libguile/tags.h for illustration).

HTH, Rotty

PS: Please consider avoiding top-posts (see for instance
<http://www.usenet-replayer.com/faq/alt.games.generals.html> for a
rationale).
-- 
Andreas Rottmann -- <http://rotty.yi.org/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]