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

Re: COPYALL, COPYLIST, et alia



Parameterized macros to the rescue.
((COPY CONS) X) => (CONS (CAR X) (CDR X))

((COPY CONS RIGHT-RECURSIVE) X) => (APPEND X NIL) ; almost!

((COPY CONS RECURSIVE) X) => (SUBST NIL NIL X) ; maybe
; does it stop at a non-cons, or at ATOM, or what?

The COPY-ALIST was a rigth-recursive copy with second-level
of ((COPY CONS) ...) 

If we really want good names it sounds like a time to
go back to the basic generalizations of tree-recursion,
and come up with a compact naming convention for them.
Otherwise, we may be stuck with:
COPY-RECURSIVE-CONS.

I doubt these copy functions are used very often. Mostly
they are used when funny RPLACing is going on in other places,
so having larger names might be a feature. The more expensive
functions should have larger names shouldn't the? (uhm...)