[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
multiple-values alternative with better destructuring
- To: john@linus.mitre.org
- Subject: multiple-values alternative with better destructuring
- From: farrow@stephanie.hc.ti.com (Rob Farrow)
- Date: Mon, 4 Jan 93 13:20:14 CST
- Cc: info-dylan@cambridge.apple.com
- In-reply-to: john@linus.mitre.org's message of Mon, 04 Jan 93 13:37:29 EST <9301041837.AA16809@thelonius.mitre.org>
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.