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

Re: Issue: REST-LIST-ALLOCATION (Version 3)



Moon writes of his example that:

  All I did was change APPLY to FUNCALL, and remove the corresponding
  &REST.  I find it inconsistent if calling with APPLY is guaranteed to
  copy one of the arguments, but calling with FUNCALL is not.

To my way of thinking, APPLY never copies any arguments so APPLY is
perfectly consistent with FUNCALL even if &REST lists are always
freshly consed.  You see, my understanding of APPLY is that it calls
its first argument on the elements of the list that is its second
argument (or the analagous thing if you give it more than two arguments).
The arguments, therefore, are the elements of the list, not the list
itself, and so the arguments are not copied.

It is true that the list created by &REST list processing may happen to
be a copy of some existing list, possibly even a list that was once
passed to APPLY, but I don't see why APPLY should be given credit for
having made the copy.

Peace, Will