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

truth of '()

   Date: Tue, 31 Jan 89 10:54:04 EST
   From: jar@void.ai.mit.edu (Jonathan Rees)
   Reply-To: jar@zurich.ai.mit.edu

   Does anyone out there seriously object to allowing the empty list to be
   considered true?  That is, permit implementations to return either #t or
   #f for  (if '() #t #f).
   I think we just didn't get around to discussing this at Snowbird, and
   I have the impression that we are ready to make this change.

   I hope we can make language decisions (at least provisionally) on this
   mailing list, without having to wait for meetings.

My understanding of the discussion at Snowbird was that it was decided that '()
and #f were not necessarily eq? in all implementations.  There is no point in
allowing this distinction if '() cannot be considered a `true value' in systems
which distinguish the two objects.  I therefore strongly urge that the truth
value of '() be unspecified.  

Going one step further, I once again must suggest that the truth values of all
objects other than #f and #t should be unspecified.  Functions FALSE? and TRUE?
should be introduced into the language ((FALSE? N) returns #t when N is #f, #f
otherwise; and (TRUE? N) returns #t when N is #t, #f otherwise).  These
procedures along with the existing ones like NULL?, PAIR?, etc. would allow all
the necessary boolean conditions to be expressed and canonicalized for use with
IF, etc.  The resulting code would, in my opinion, be much easier to read and
less error prone.  Since I suspect that compatability with old code is the
major impediment to people agreeing to such a change, let me suggest that the
old semantics booleans can easily be retrieved from the new by using a few
simple macros for IF, etc.  (While we still haven't managed to standardize
macros, I am sure that all existing Scheme systems have them, so backwards
compatability is possible in this manner.)  Lets not get hung up on history,
but rather fix this traditionally poor semantics.

					Morry Katz