[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
truth of '()
Date: Wed, 01 Feb 89 17:06:06 PST
From: Pavel.pa@Xerox.COM
Morry says, ``use of PAIR?, etc. forces the programmer to specify the types
of values he/she expects the given function to return and consequently
informs the reader of this information''.
This is only true if the function is expected to return several different
kinds of values (otherwise, the test would not be necessary and thus would
not appear). The kinds of tests used now are precisely the same as this.
Every time I say (if (foo) (bar) (baz)), in your system I might just say
(if (false? (foo)) (baz) (bar)). This doesn't tell you any more than the
other. When I use PAIR?, you only know that pairs are one of the
possibilities; you have no notion of the other possibilities. In current
Scheme, when I say (if (foo) ...) you know that #f is one of the
possibilities. This seems symmetric to me. I see no reason to prefer the
type of pairs over the type containing only #f.
Pavel
The problem is that as things currently stand false is not a given object or
type, but actually a set composed of #f, '(), and maybe something else in some
implementations. Furthermore, I can only repeat my statement that TO ME it is
much clearer when code uses the NULL? and FALSE? predicates, then when it does
not. (I guess you just can't account for taste, but thats mine.)
Morry Katz
katz@polya.stanford.edu