[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue: REDUCE-ARGUMENT-EXTRACTION (version 1)
- To: Daniels.pa@Xerox.COM
- Subject: Re: Issue: REDUCE-ARGUMENT-EXTRACTION (version 1)
- From: Dan L. Pierson <pierson@multimax.ARPA>
- Date: Wed, 09 Dec 87 11:51:12 EST
- Cc: cl-cleanup@sail.stanford.edu
- In-reply-to: Your message of 08 Dec 87 14:10:00 -0800. <871208-141224-5386@Xerox>
From: Daniels.pa@Xerox.COM
Subject: Re: Issue: REDUCE-ARGUMENT-EXTRACTION (version 1)
Masinter writes:
I think that it is true that
(reduce <fn> sequence :key <key-fn>) = (reduce <fn> (mapcar
<key-fn> sequence))
except of course in the matter of order of evaluation.
Well, that and the fact that MAPCAR doesn't work on arrays...
Make that:
(reduce <fn> sequence :key <key-fn>) =
(reduce <fn> (map 'list <key-fn> sequence))
Feel free to replace the "'list" with your favorite sequence type.
I'll change REDUCE-ARGUMENT-EXTRACTION to use this construct as the
present case. You're absolutely right that my previous code was badly
broken and attempts to fix it up produce a real mess. This almost
makes it interesting because the result is as cons-efficient as the
proposed new feature, while the mapping approach builds a whole new,
unecessary structure.