[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use of MULTIPLE-VALUE and VALUES
- To: GSB at MIT-MC
- Subject: Re: Use of MULTIPLE-VALUE and VALUES
- From: Jon L White <JONL at MIT-MC>
- Date: Fri ,30 Jan 81 19:38:00 EDT
- Cc: LISP-FORUM at MIT-MC
Re your conjecture:
Date: 30 January 1981 16:32-EST
From: Glenn S. Burke <GSB at MIT-ML>
Subject: optimizers
. . .
For one, it is a complete loss that to utilize such a feature
one must use multiple values, ESPECIALLY in Maclisp. I might feel
differently if the support were small and efficient, but . . .
I don't know if there is a polite way to say this, but you seem to
have lost all perspective on this facility:
(VALUES x y)
Compiles into code that is exactly 2 (simple) instructions executions
longer than merely setq'ing X and Y
(MULTIPLE-VALUE (X Y) (<m-v-function> ...))
Compiles into code that is exactly 3 (simple) instructions executions
longer than merely calling the function and setq'ing X and Y, except
when there are too few return values, in which case an ** autoloadable **
function would be called. (Even the out-of-core file needn't be loaded if
one supplies his own "patch-over" function here). (Checking for failure
to return "multiple-values" could be done, at a cost of about another
2 instructions, but this check is debatable.)
If the top cell of an arg to "Filter/optimizer" is to be copied,
then surely that copying itself will take more time than those few
instructions. If one has 50 (!) "Filter/optimizer" functions in his
system, *** and if it could be proven that the two-value return is indeed
two words longer than any other alternative **, then he will lose all of
100 words out of his address space. Really big deal.
Using VALUES and MULTIPLE-VALUE doesn't require one to use VALUES-LIST
or MULTIPLE-VALUE-LIST; but even if one did use them, I don't think
a MacLISP implementation of them could be made significantly smaller
and more efficient. Also, the macro support lives in the MLMAC file,
which isn't generally loaded in a user's system; with all that space
reclaimed in the compiler recently, how could one carp about a couple
hundred words of new macros? especially for such a winning idea
as multiple values.