[Top][All Lists]

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

Re: [Chicken-users] Request for comments on the SQLite3 egg API

From: John Cowan
Subject: Re: [Chicken-users] Request for comments on the SQLite3 egg API
Date: Tue, 3 Jul 2007 11:23:05 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Ivan Shmakov scripsit:

>        I feel that the semantics of an ``unspecified value'' is, well,
>        underspecified.  Is it guaranteed, e. g., that (eq? (void)
>        (void)) will always be true?  (So that (sql-null? o) function
>        could be implemented.)

In Chicken it definitely is guaranteed.  The unspecified value is an
unboxed value, like fixnums, characters, #t, #f, and the pseudo-value
given to unbound variables.

> > If you want nearly the same behaviour as now, no action is
> > required. If you want a NULL singleton, add the line
> > (sqlite3:null-value (void)) or (sqlite3:null-value (make
> > <sqlite3:null>)) to the top of your program and you're done.
>        ... Provided that there's not a line of code, not in program,
>        nor in a library used, which assumes #f is a SQL NULL.

I have to agree.  Separate compilation of eggs makes a trick like
this semi-useless, as you will end up with inconsistent definitions
over time.  If we are going to break the sqlite3 egg, let's go ahead
and break it along with all the other database eggs.

>        I don't really feel like using an arbitrary Scheme object as a
>        SQL NULL value, just the way I won't like using an arbitrary
>        Scheme object as an EOF value, or as an empty list.  In
>        particular, I feel it could easily be abused, raising an
>        incompatibility between different libraries, which could assume
>        different objects to correspond to SQL NULLs.

Which is precisely why we should settle on a single Chicken-wide
convention.  Chicken's undefined object is easily accessible, it occupies
no storage, it is self-eq?, it is disjoint from all other types.  Your API
(which I like) will work fine: sql-null is void, and sql-null? is void?,
that's all.

John Cowan              address@hidden
C'est la` pourtant que se livre le sens du dire, de ce que, s'y conjuguant
le nyania qui bruit des sexes en compagnie, il supplee a ce qu'entre eux,
de rapport nyait pas.               -- Jacques Lacan, "L'Etourdit"

reply via email to

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