bug-guile
[Top][All Lists]
Advanced

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

Re: GIT version: values


From: Hans Aberg
Subject: Re: GIT version: values
Date: Thu, 27 Jan 2011 14:20:32 +0100

On 27 Jan 2011, at 10:00, Andy Wingo wrote:

  If you wish to preserve a potentially
  multiply-valued return, you will need to set up a multiple-value
  continuation, using `call-with-values'.

But this is false.

According to the standard, passing an unintended number of values to a
continuation is undefined.

Right. Because of this, no extension is reliable - can be changed in the future.

To portably preserve a potentially
multiply-valued return, you need call-with-values.

You can still implement other paradigms on top of this. If you want to
express some semantics that is not specified in the report, write a
macro that wraps your expressions in call-with-values.  This is
effectively what we will do for Lua, for example.

Yes, this is what I do, first by a macro, and now, via a new tuple type (right now a smob), a function call.

But tuples might be integrated into Scheme, so that the underlying call-with-values become transparent.

For example, if (lambda x a) would have made the multiple values that x picks up as 'values', then (lambda x x) becomes the identity. Now this syntax is occupied, but it illustrates the idea.




reply via email to

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