chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] New immediate values (was: DBI)


From: felix winkelmann
Subject: Re: [Chicken-users] New immediate values (was: DBI)
Date: Fri, 29 Feb 2008 12:54:56 +0100

On Fri, Feb 29, 2008 at 1:31 AM, Tobia Conforto <address@hidden> wrote:
> Graham Fawcett wrote:
>  > There does seem to be a good case for an immediate value that *can*
>  > be tested this way, though. John et. al. wouldn't have used (void)
>  > in eggs if there weren't.
>
>  What about providing a utility to create new immediate values,
>  disjoint from anything else?
>
>  The immediate value space is far from cramped, if I'm not mistaken.
>  Such a new-immediate-value function (which could benefit from a better
>  name) would return a new value every time it's called, using for
>  example an internal counter.  One could write:
>
>  (define sql-null (new-immediate-value))
>
>  (define (sql-null? x) (eq? x sql-null))
>
>  With the certainty that sql-null won't be eq? to anything else at all,
>  won't be a list, a record, nothing at all except itself.
>
>  I think this could have a few uses.  (Unless it's terribly broken in a
>  way I can't see, which is quite possible :-)
>

It would probably have uses, but what would you gain? All you need
is a distinct unique object:

(define sql-null (gensym 'sql-null))


cheers,
felix




reply via email to

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