This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: eval.c


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> as pointer to a single SCM value.

No.  It's not only a SCM value but a pointer to a concrete vcell.  
(a . 12) for example or (a . UNDEFINED) which means that this cell is
undefined.  The current module system (see `sym2vcell') returns the
value UNDEFINED iff the cell doesn't exist at all, in which case the
lookup method must return a pointer to undef_cell.

So at the moment UNDEFINED and undef_cell are two different
things.  


> Thus, I am going to replace the definition by:
>   static SCM undef_object = SCM_UNDEFINED;
> and to replace the code in scm_lookupcar by:
>   return &undef_object;
> and everything is fine and a little bit clearer.

In this case you can nuke `undef_object' completely and return a
pointer to the variable that holds the return value of sym2vcell().

But if you do this, you must insert additional SCM_NIMP() checks
before checking the cdr of the vcell against SCM_UNDEFINED (maybe the
new code does this automatically, I don't know).


Jost

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]