Subject: Re: Case Implementation
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/10/20
Newsgroups: comp.lang.lisp
Message-ID: <7uja9c$5g6mm@fido.engr.sgi.com>
Howard R. Stearns <howard@elwood.com> wrote:
+---------------
| The specifications for CASE and TYPECASE both say:
|   Each of the normal-clauses is then considered in turn. If the
|   test-key [matches the key for that clause], the forms in that
|   clause are evaluated as an implicit progn, and the values it returns
|   are returned as the value of the [entire] form. 
| 
| Since (PROGN) => NIL, I would assume that when a clause with no forms
| is selected, NIL is returned from the entire CASE/TYPECASE form.  I
| believe this interpretation is consistent with current practice, and
| what users expect.
+---------------

Interesting... It's certainly what CMUCL returns:

	* (case 3 (4 'foo) (3) (t 'bar))
	NIL
	* 

but not CLISP!!

	> (case 3 (4 'foo) (3) (t 'bar))
	T
	> 

[Well, CLISP "1996-04-17 (April 1996)". Maybe fixed by now...?]


-Rob

-----
Rob Warnock, 8L-846		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA