Tom Breton <tob@world.std.com> wrote:
+---------------
| IOW, values is basically a backwards-compatibility thing.
| When that's *not* the case, simply returning a list is better in every
| way that springs to mind, IMO.
+---------------
Actually, a third option -- which I find myself using a lot more often
than *either* multiple values or lists -- is to return a structure:
- It's relatively cheap to construct;
- It's cheaper than a list to access elements other than the first; and
- The slot names give you an element of self-documentation that's missing
with either lists or MVs (that is, on the "values" side of MVs -- the
using or destructuring side is of course quite self-documenting).
But like the other two, it's not always appropriate. So use the one that is.
-Rob
p.s. In Schemes that don't have structures (there are still a few), I
sometimes return small vectors. That's yet another option in CL, too.
-----
Rob Warnock, 41L-955 rpw3@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. PP-ASEL-IA
Mountain View, CA 94043