Rainer Joswig <joswig@lavielle.com> wrote:
+---------------
| mikemac@mikemac.com wrote:
| > >>> let (p, v) = find-position-and-velocity(rock, time);
| > >>
| > >>How was it done in the prefix syntax?
| > >>
| > (bind ((p v (find-position-and-velocity rock time)))
| > <body>)
|
| Not an exact presentation of infix advantages. ;-)
+---------------
MzScheme's "let-values" is even a little cleaner, I think, by using
ordinary "let" syntax but making the destructured vars be a list, e.g.:
(let-values (((p v) (find-position-and-velocity rock time)))
<body> )
And since it's a let-like form, you can do multiple destructurings
at once [rather than a bunch of nested "multiple-value-bind"s]:
(let-values (((p0 v0) (find-position-and-velocity rock0 time))
...
((pN vN) (find-position-and-velocity rockN time)))
<body> )
I don't know Dylan's infix at all; does its "let" allow more than one
multi-valued binding in one "let"? If so, what's the syntax?
-Rob
-----
Rob Warnock, 8L-855 rpw3@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. FAX: 650-933-0511
Mountain View, CA 94043 PP-ASEL-IA