You are looking at historical revision 5135 of this page. It may differ significantly from its current revision.

sql-null

The sql-null extension implements the following interface.

 (sql-null) 

Return an object, corresponding to a SQL NULL value. The object is guaranteed to be of a type disjoint from all of the R5RS' standard types. It's unspecified whether the values returned by this function will be `eq?' to each other:

 (eq? (sql-null) (sql-null)) => unspecified. 
 (sql-null? OBJECT) 

Return #t if OBJECT is a SQL NULL object. Return #f otherwise.

 (sql-not OBJECT) 

Return OBJECT if OBJECT is a SQL NULL object. Return the value of `(not OBJECT)' otherwise.

 (sql-not (sql-null)) => SQL NULL;
 (sql-not 'a) => #f; 
 (sql-not #f) => #t;
 (let ((null (sql-null)))
   (eq? null (sql-not null))) => #t. 
 Syntax: (sql-and TEST-1 ...) 

The TEST expressions are evaluated from left to right, and the value of the first expression that evaluates to a false value is returned, and any remaining TESTs are not evaluated. If there were no expressions to evaluate to a false value, the value of any of the expressions to evaluate to a SQL NULL is returned. If there were no such expressions as well, #t is returned.

 (sql-and 1) => 1; 
 (sql-and #t (sql-null)) => SQL NULL; 
 (sql-and #f (sql-null)) => #f.  

In the absence of the expressions that evaluate to SQL NULL values, the semantics is the same as for `(and test-1 ...)'.

 Syntax: (sql-or test-1 ...) 

The TEST expressions are evaluated from left to right, and the value of the first expression that evaluates to a value, other than SQL NULL and a false value (a ``SQL true'' value), is returned, and any remaining TESTs are not evaluated. If there were no expressions to evaluate to a SQL true value, the value of any of the expressions to evaluate to a SQL NULL is returned. If there were no such expressions as well, #f is returned. In the absence of the expressions that evaluate to SQL NULL values, the semantics is the same as for `(or test-1 ...)'.