guile-devel
[Top][All Lists]
Advanced

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

Re: gh_lookup() equivalent


From: Neil Jerram
Subject: Re: gh_lookup() equivalent
Date: 29 Jan 2002 23:32:02 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "stefan" == stefan  <address@hidden> writes:

    stefan>    [FIXME:
    stefan>    should this be SCM_UNSPECIFIED?  Can a symbol ever legitimately 
be
    stefan>    bound to SCM_UNDEFINED or SCM_UNSPECIFIED?  What is the 
difference?
    stefan>    -twp]

    stefan> If you can gurantee the return value cannot be bound to a symbol 
you can
    stefan> use the replacement code you proposed.  If not we would need a 
further
    stefan> argument *and* a return value.

In general, no, you can't guarantee that a lookup won't result in
SCM_UNSPECIFIED, SCM_UNDEFINED, SCM_UNBOUND or whatever.

But you don't need to.  scm_sym2var returns either SCM_BOOL_F or a
variable object.  If it's a variable object, you'll need to use
SCM_VARIABLE_REF to get the actual value.  See the code for (funnily
enough :-) gh_lookup for details.

        Neil




reply via email to

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