guile-devel
[Top][All Lists]
Advanced

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

Re: Removal of SCM_UNBOUND


From: Mikael Djurfeldt
Subject: Re: Removal of SCM_UNBOUND
Date: Mon, 17 Apr 2006 10:21:41 +0200

On 4/16/06, Neil Jerram <address@hidden> wrote:
> Just to check my understanding: I believe the existing SCM_UNBNDP
> macro, which is used in C code to check for the presence of an
> optional argument, expands to (x == SCM_UNDEFINED); I presume that
> SCM_UNBOUND is a distinct value (and somewhat confusingly unrelated to
> SCM_UNBNDP) used by GOOPS to indicate an unbound slot.

Right.  (If I remember correcty, the SCM_UNBOUND/SCM_UNBNDP confusion
was present already in the version of SCM which Guile originally was
based on.  At that time, SCM_UNBOUND was used to mark an unbound
variable, so it is natural for GOOPS to use it to mark an unbound
slot.)

> Then, as Mikael says, bugs may be introduced where a Scheme primitive
> takes an optional argument and passes that argument on, untranslated,
> to code that uses that value to set or test a slot's value.
>
> That sounds unlikely, though.  In my experience, I've never noticed
> SCM_UNDEFINED escaping onto the Scheme level, and all the primitive
> code that I can remember immediately translates SCM_UNDEFINED to some
> locally meaningful default value.

No, that's not what I mean.  Rather, I think code internal to GOOPS
will at some instances extract and pass on the SCM_GOOPS_UNBOUND
value. If SCM_GOOPS_UNBOUND is defined to be the same value as
SCM_UNDEFINED, then SCM_UNDEFINED will escape this way, which
obviously leads to problems.




reply via email to

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