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

multiple-values alternative with better destructuring



John Burger writes:

>They all do.  All CommonLisp forms, and all Dylan forms, return
>multiple values.  For most of them, N=1, for some N=0 or N>1.


A couple of Common Lisp primitives which don't handle multiple-values
are OR and SOME, there may be others.

Examples:
	(or (values 1 2) nil) ;=> 1
	(or nil (values 1 2)) ;=> (values 1 2)

I have used versions of COND which also didn't handle multiple-values
correctly.  This may be a bug or an implementation dependent behavior.
The major Lisp vendors are pretty good about doing what seems right in
multiple-values cases.  But it would be nicer to simplify what SHOULD
happen.


-- Rob.