[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MULTPLE-VALUE-OR &rest args
- To: MURRAY%cs.umass.edu@RELAY.CS.NET
- Subject: MULTPLE-VALUE-OR &rest args
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Mon, 27 Apr 87 14:04 EDT
- Cc: common-lisp@SAIL.STANFORD.EDU
- In-reply-to: The message of 21 Apr 87 15:45 EDT from MURRAY%cs.umass.edu@RELAY.CS.NET
Date: Tue, 21 Apr 87 15:45 EDT
>I don't think this conclusion follows from your previous paragraph.
>If the proposed MULTIPLE-VALUE-OR can easily be implemented in terms of
>existing primitives, such as MULTIPLE-VALUE-CALL, and would be efficient
>if there were non-consing &rest arguments, and non-consing &rest arguments
>are desirable for other reasons, then I think a more logical conclusion is
>"because non-consing &rest arguments can only be done efficiently by low-level
>implementation-specific code, they should be in Common Lisp."
Are you just pointing out a flaw in my logic, or are you suggesting that
Common Lisp REQUIRE certain &rest args to not cons?
I was suggesting that a declaration which, like all declarations,
encourages but does not require the compiler to generate a certain kind
of code, could be added to Common Lisp. If it were added, it would be
more broadly applicable than MULTIPLE-VALUE-OR, and would eliminate the
need for MULTIPLE-VALUE-OR as a special language construct since it
would make the portable definition of MULTIPLE-VALUE-OR efficient.
The last sentence
was not meant to logically follow from the previous -- I was merely
re-iterating my point in requesting a MULTIPLE-VALUE-OR form, which is it
can be efficiently implemented WITHOUT non-consing rest args. I might
also add that using MULTIPLE-VALUE-CALL is going to require both
a Lambda and a Block, in which the Return-From will end up being a Throw.
You are assuming that (multiple-value-call #'(lambda ...) ...) cannot be compiled
as efficiently as ((lambda ...) ...). I see no justification for assuming that.