[Top][All Lists]

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

Re: Removal of SCM_UNBOUND

From: Neil Jerram
Subject: Re: Removal of SCM_UNBOUND
Date: Sun, 16 Apr 2006 00:26:14 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

"Mikael Djurfeldt" <address@hidden> writes:

> While putting together my daugther's Easter egg, I suddenly realized
> that the thing that mght bite you is that many parts of GOOPS is
> written in Scheme so that, if this UNBOUND value is eqv? to
> SCM_UNDEFINED, things go wrong as soon as any Scheme primitive, used
> by GOOPS itself, happen to get this value passed in an optional
> argument.
> I think there *are* instances like this so that making them eqv?
> really does introduce a bug.  But even if it doesn't right now, having
> them eqv? seems likely to introduce future bugs.

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.

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.


reply via email to

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