[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Replies to Extension to MAP
How about, if the first arg to MAP is an integer, it specifies
which argument should be clobbered? This doesn't allow an
unrelated sequence to be be clobbered, of course, but it does
allow the common case of an in-place MAP operation.
This is a joke, right?
If people really want a form that works like MAP but is destructive of
one of the sequences, it is trivial to define a macro to do the job.
If people really think that this is so useful that we need to add it to
Common Lisp, the right way to do this is to define some new function,
with a new name, that does this job.
The idea of extending MAP in a compatible way was cute, but dangerous:
it is usually a mistake to overload the same function to do two
fundamentally different things depending on some subtle type
distinction. If you want a destructive operation, you should ask for it
by name. Then if a sequence gets clobbered mysteriously, you have some
hope of finding the code responsible.
Since the original MAP proposal turned out to be unworkable, I think it
is best to let it die rather than trying think up even more subtle ways
to sneak this behavior into MAP.
-- Scott