[R6RS] Convenient syntax for multiple values

Manuel Serrano Manuel.Serrano
Thu Dec 16 05:20:12 EST 2004

> Manuel> No, please. SRFI forces an additional round of decoding variables arguments
> Manuel> and list allocation. May I suggest a Common Lisp (and Dylan) like syntax:
> Manuel> (multiple-value-bind (v1 v2 v3 ..)
> Manuel>    <sexp>   ;; PRODUCER
> Manuel>    <sexp>)  ;; body
> Huh?  Could you be more specific?  I see no list allocation in the
> definitions of these macros.  (Except when you use a rest list, of
> course.)  Specifically, I don't see how the above would need to be
> intentionally any different from
> (let-values (((v1 v2 v3 ...) proceder))
>   body)
> On Scheme 48, both expand to beta-equivalent code, for which the compiler
> then produces identical code.
I have the impression that the LET-VALUES form more or less implies
that, at some point, multiple values are represented by lists. 
I dislike that. 

I find pretty unpleasing that as soon as I say something there is
someone here to answer something such as "no because in my clever
implementation the form blabla is efficiently implemented as ...".  I
find this very unpleasing and I feel that it is time for me to
react. I don't think that I have to be lectured on how to implement
Scheme efficiently. If you think I do, go to the shootout benchmarks
page, submit your implementation and compare it with Bigloo. Alternatively,
please send me your papers demonstrating better performance than Bigloo.

For your information, in Bigloo, the form:

(multiple-value-bind (a b c)
  (foo bar)
  (list a b c))

requires no allocation (except, of course, the construction of the
list).  In particular, FOO does not allocate any data structure. I
think this is no so easy to get such efficiency with LET-VALUES,
especially in the context of an interpreter that cannot afford
sophisticated optimization.


More information about the R6RS mailing list