Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Summing a list Message-ID: <29856@think.UUCP> Date: 28 Oct 88 19:44:06 GMT Article-I.D.: think.29856 References: <10794@srcsip.UUCP> <10813@srcsip.UUCP> <249@pitstop.UUCP> <3780@cs.utexas.edu> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 19 In article <3780@cs.utexas.edu> farquhar@cs.utexas.edu (Adam Farquhar) writes: >For example, one would like to be able to say > (reduce #'+ (list box1 box2 box3 box4) :key #'box-weight) >Does anyone know why :key was left out? Is there an elegant way to do >this in CL? I don't know why :KEY was left out. In my opinion, the best way to do this currently is (flet ((+-weight (x y) (+ (box-weight x) (box-weight y)))) (reduce #'+-weight ...)) Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar