[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: define and set! with multiple-values
- To: "Ben A. Hyde" <bhyde@GENSYM.COM>
- Subject: Re: define and set! with multiple-values
- From: Scott_Fahlman@SEF-PMAX.SLISP.CS.CMU.EDU
- Date: Thu, 31 Dec 92 15:01:22 EST
- Cc: info-dylan@CAMBRIDGE.APPLE.COM
- In-reply-to: Your message of Thu, 31 Dec 92 13:41:14 -0500. <9212311841.AA10900@gensym.com>
As a programmer I like and enjoy multiple return values, it would be
sad to see them go.
I think that makes you nearly unique. The vast majority of Common Lisp
programmers I've talked to consider multiple values to be an ugly blot on
the language (one of many), but a perhaps-necessary evil.
Multiple values do make life *much* harder for implementors.
It would be interesting research to find out what the complexity/pain
for programmer and implementer of stricter rules placing stricter
rules on return value count.
I wasn't suggesting "stricter rules on return value count". I was
suggesting the very strict rule that *every* function should return exactly
one value, and if you want to pass back a bunch of things you do it in a
sequence or as a side effect or something like that. Then count on the
"sufficiently smart compiler" to avoid having to actually heap-allocate the
return sequence. But I don't have a specific proposal to make right now.
There are definitely cases where you want to return multiple values without
consing, and we must provide for these cases, but it seems a shame to
complicate normal function calls and returns in order to allow for these
relatively rare cases.
Scott E. Fahlman Internet: firstname.lastname@example.org
Senior Research Scientist Phone: 412 268-2575
School of Computer Science Fax: 412 681-5739
Carnegie Mellon University Latitude: 40:26:33 N
5000 Forbes Avenue Longitude: 79:56:48 W
Pittsburgh, PA 15213