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

Re: Proposal #13: Structure Sharing in Arguments



I would ask for freshly consed &REST lists for all functions, because
the alternative is too bug-prone.  I am not convinced by the argument
against consing APPLY args:

    Date: Sat, 26 Jul 86 17:12 EDT
    From: Daniel L. Weinreb <DLW@QUABBIN.SCRC.Symbolics.COM>

    ...  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....

I believe this sort of programming style is best done by passing the
&REST arg itself to the lower-level functions, rather than by calling
APPLY.  In the case of FORMAT, the modification is simply to use "~?".

I do not intend this argument to apply to macro arguments.  I lean
towards the view that macro arguments should NOT be consed--that the
&REST argument to a macro should be the list itself.

Dan Hoey