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

'() and #f



As one of the ones that seems to have engendered this huge argument/rift, I
would like to publicly appologize for starting this mess.  I would like to make
a few (hopefully short) statements and then pul;l back from the fray.

1)  I am personally willing to give up my effort to madate that '() and #f be
disjoint in the IEEE standard.  However, I would STRONGLY urge that editors of
both RNRS and IEEE to include a footnote or comment to the effect that the
possibility of disjointness of these types in an implementation requires that
portable code guarantee that '() will never get used in a boolean context
(e.g., as the predicate in an IF).

2)  I continue to strongly believe in the desirability of a disjoint type for
'() in Scheme and reserve the write to restart this argument at the next RNRS
meeting.

3) I agree with Daniel that only boolean values should be allowed in boolean
contexts.  My earlier "(if '() a b) -> error" was actually a Freudian slip
which I backed off from because I did not want to broaden the argument at the
time.  I DO believe that the above should be an error.  I would advocate adding
not only NULL?, but also FALSE? and TRUE?, to Scheme (or maybe some successor
language).  They would have the following definitions:
(define null? (lambda (a) (eqv? '() a)))
(define false? (lambda (a) (eqv? #f a)))
(define true? (lambda (a) (not (false? a))))

3a)  Returning to another previous RNRS discussion, I would also restrict AND
and OR so that they would only operate on boolean values and would be return
boolean values.  I believe that the function of AND and OR on non-booleans
should be achieved using IF and appropriate abstration (if desired) with
macros.  [Yes, I do remember that we don't yet have macros, but I am still
hoping!] 
-------------------------------------------------------------------------------
Morry Katz
katz@cs.stanford.edu
-------------------------------------------------------------------------------