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: Richard Shann
Subject: Re: scm_defined_p(sym, env)
Date: Wed, 24 Aug 2011 21:25:21 +0100

Thanks for this, I see there is also scm_is_true to take care of the
possibility that SCM_BOOL_T might not be a scalar type, we should be
using that too.

Richard

On Wed, 2011-08-24 at 12:01 -0400, address@hidden wrote:
> 
> 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 




reply via email to

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