[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: REDUCE args
- To: NGALL@G.BBN.COM, ALR%OZ.AI.MIT.EDU@XX.LCS.MIT.EDU
- Subject: Re: REDUCE args
- From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>
- Date: Thu, 24 Jul 86 14:59 EDT
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: <[G.BBN.COM]24-Jul-86 13:39:15.NGALL>
Date: 24 Jul 1986 13:39-EDT
Date: Thu, 24 Jul 1986 13:11 EDT
Subject: REDUCE args
In-Reply-To: Msg of 24 Jul 1986 00:23-EDT from NGALL at G.BBN.COM
Does anybody else wish that REDUCE took a KEY argument, similarly to MEMBER.
(reduce #'+ list-of-objects :KEY #'object-quantity)
would apply the function OBJECT-QUANTITY to each element of the
list-of-objects before reducing it with +.
YES! I ran into the same need a while back.
Ditto. I think GLS made some comment about this usage of :KEY being
different than most. Maybe that was in a different discussion. There
are possibly other related operations that should take KEY. One could
also add :TEST to avoid calling the operator on objects you don't want
to. Maybe this was Steele's point: Does the key apply before or after
the test? I think the intuitive usage is backwards from the other