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

Benefit of multiple values.



   Date: Thu, 31 Dec 1992 13:23:09 -0800
   From: ksand@apple.COM
   Concerning the use of multiple return values, I've always wondered
   what is the difference concerning returning multiple values and returning
   a list (or a collection class object).

Having (values ...) and (bind ...) forms are a convenience factor for
returning multiple values, receiving multiple values, and choosing to
ignore some of the values returned. Forcing programmers to handle all
of this in data structures just provides more opportunities to get
something wrong.

With a macro facility, one could write macros to package a structure
and unpack it on the other end, but then if enough people like your
macros, why not make it a part of the language? Once it is a part of
the language then the compiler can step in and optimize things, like
put multiple values in registers or on the stack to reduce superfluous
cons'ing.
--
Patrick Logan         patl@goldfish.mitron.tek.com
Mitron Corporation    (503) 690-8350    FAX: (503) 690-9292
15256 NW Greenbrier Pkwy, Beaverton, OR 97006