On Wed, Feb 27, 2008 at 6:29 PM, Ozzi <[EMAIL PROTECTED]> wrote: > > I suggest that a row be an a-list, and that null columns be represented > > by being non-existent in the a-list. If you end up preferring a plain > > list or a vector, then use (void) instead -- I am trying to get this > > standardized as the Chicken representation of SQL's NULL. > > Is there an argument against using '() instead of (void) SQL NULL values?
Three that I can think of: 1) It would make alist representations ugly: (query "select foo, NULL as bar, baz from stuff") => ((foo . 1) (bar) (baz . "a string")) 2) It is not a disjoint type. (list? '()) => #t. That's bad. 3) As a special case of (2), some databases have array-type columns. An empty list may be a valid column value. Personally, I'm okay with (void), though Vincent's comment about displaying results is a good one. I think the only logical alternative to (void) is a #<sql-null> value, similar in implementation to #<undefined>: a disjoint type plus a predicate. (Currently that's how the postgresql egg handles it.) Graham _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
