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

Re: [Scheme-reports] multiple values module



Emmanuel Medernach scripsit:

> Why not specifying that arguments in procedure calls should each
> evaluate to exactly one value ?

Everyone agrees that (+ (values 1 2) (values 10 20)) is meaningless,
but that does not mean that every implementation must be required to
treat it in exactly the same way.  As things stand, some implementations
report errors, others silently truncate multiple values to a single
value, CL-style.

I tested my usual suite of Schemes with (+ (values 1 2) (values 10
20)).  MIT, Gambit, Kawa, Chibi, Ypsilon, IronScheme, STklos complain
in a way that make it clear they are reifying multiple values; Racket,
Scheme48/scsh, SISC, Chez, Ikarus complain in a way that makes it
impossible to tell; Gauche, Chicken, Bigloo, Guile, Larceny, Mosh,
STklos return 11, showing that they silently truncate.  (Scheme 9
does not provide multiple values.)  So this distinction cuts across the
R5RS/R6RS divide.

Note: In an earlier test using (+ (values 1 2)), Guile actually returned
two values, suggesting that it believes (+ <foo>) always returns <foo>.
Conformant but surprising.

-- 
John Cowan      http://www.ccil.org/~cowan      cowan@x
Be yourself.  Especially do not feign a working knowledge of RDF where
no such knowledge exists.  Neither be cynical about RELAX NG; for in
the face of all aridity and disenchantment in the world of markup,
James Clark is as perennial as the grass.  --DeXiderata, Sean McGrath

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports