This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: another nit.
- To: "Harvey J. Stein" <hjstein at bfr dot co dot il>
- Subject: Re: another nit.
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Fri, 7 Jul 2000 00:13:42 +0200 (MEST)
- cc: hanwen at cs dot uu dot nl, Guile Mailing List <guile at sourceware dot cygnus dot com>
On 6 Jul 2000, Harvey J. Stein wrote:
> If, on the other hand, the inability to use #f as a value is a
> shortcoming you want to overcome, you can make up a special value
> that can be in the list to denote undefined:
>
> (define *my-undefined* (cons (gensym) (gensym)))
Another approach that can be used on the C level is to define a special
smob with exactly one value, namely *my-undefined*. This is even safe
with regards to type tests as
(pair? (get-property foo))
although it has the disadvantage of wasting one smob type. Maybe the use
of goops would help to avoid this disadvantage, but I think you get the
idea.
Best regards
Dirk