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

Structure sharing in arguments



The question of whether &rest args can be destructively modified has
become muddled together with the related question of whether they can be
returned from a function or otherwise passed outward.  The old Lisp
Machine trick of stack-consing these things loses in such situations.

Setting aside, for now, the question of destructive modificationof &rest
args, I would like to get a clarification on the stack-consing business.

DCP says:

    [Yes, Symbolics uses stack-consed &rest lists, and they will screw you
    every now and then.  >>> My view of our current position <<< is that the
    efficiency issues (e.g., not calling copy-list on every &rest arg) are
    outweighed by the programmer resources needed to implement the copying
    only when necessary.]

My understanding, from the last time we discussed this, was that
everyone agreed that this behavior was illegal in Common Lisp (the &rest
arg is supposed to be a LIST, and not some object that disappears on
you), and that the Symbolics position was that their system should
detect those situations where stack-consing is unsafe and copy those
rest-lists to the heap.  I think I heard that this was already being
done, but maybe this is one of those "in release 27, not yet delivered"
kinds of things.

Do we agree that it is illegal for rest-arg lists to evaporate, or is
that another issue that we have to discuss?

-- Scott