kawa-commonlisp-dev
[Top][All Lists]
Advanced

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

Re: [Kawa-commonlisp-dev] Multiple value binding


From: Jamison Hope
Subject: Re: [Kawa-commonlisp-dev] Multiple value binding
Date: Fri, 3 Aug 2012 14:46:33 -0400

On Aug 3, 2012, at 1:16 PM, Helmut Eller wrote:

On Fri, Aug 03 2012, Charles Turner wrote:

Should I go for the rough solution and continue testing
DESTRUCTURING-BIND or try to pursue the approach outlined by Jamison?

I'd go with the rough solution, because changing calling conventions
tends to be tricky.

Agreed. Let's circumvent the subtleties for now. Your rough solution
will continue to work once this gets addressed, right? It'll just
appear to be unidiomatic to a Lisper. Maybe put a TODO comment
mentioning that you're temporarily working around an implementation
bug and to revisit once it's fixed.

My sketch was incomplete, anyway. Consider:

(multiple-value-bind (a b) (values 1 2 3) (list b a)) ;; => (2 1)
(multiple-value-bind (a b) (values 1)     (list b a)) ;; => (NIL 1)

What it really needs to do is coerce N return values to the M values
expected by the continuation, where all of these scenarios are legal:
M == N
M < N
M > N

FWIW, I think that (let ((x (values))) x) should be an error in Scheme
and that the various RNRSs are ridicoulsy underspecified.

They are of course underspecified by design. I will avoid making any
political statements about the de facto Scheme standards on a
Common Lisp mailing list. :-)

Jamie

--
Jamison Hope
The PTR Group
www.theptrgroup.com






reply via email to

[Prev in Thread] Current Thread [Next in Thread]