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

Proposal #13: Structure Sharing in Arguments



OK, I was exaggerating or overstating to the point of misstating myself;
I apologize.  The reason for the &rest feature, as defined, is so that
functions can take arbitrary numbers of arguments, without going through
the obscure locution of consing up a semantically unnecessary list, and
without various problems of the Maclisp "LEXPR" construct, and without
undue inefficiency.

However, I don't think it's acceptable to require that the list be
freshly consed.  Your message disregards an important case.  One of the
things that's very useful to do with &rest arguments is to "pass them on
down" to further functions, using apply.  Having used &rest for a long
time, we've found this usage pattern to be extremely common.  For
example, we have many functions that take several arguments, followed by
a FORMAT control string, followed by an arbitrary number of format
arguments.  We have programs that do this passing-down to many levels of
depth.  By requiring that the entire list be copied for every such call,
the cost of function calling is raised very considerably.  Such an
extreme penalty will strongly encourage programmers either to stay away
from function calling in such circumstances, or go back to explicitly
consing up lists in order to prevent the cost of copying.

I hope this clarifies what I was trying to say.