Re: max-key taking a list rather than different number of args

2010-11-15 Thread Tom Hall
> > You should be able to use (apply max-key f someseq); apply takes a variable > number of args, and only the last is expanded. > Thanks, thought there would be something like this! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: max-key taking a list rather than different number of args

2010-11-14 Thread Stuart Campbell
On 15 November 2010 14:17, Tom Hall wrote: > Hi, > > I think a better usage for max-key would be > (max-key f someseq) > rather than passing the values as args. > > I used > (defn max-key-seq [f someseq] > (apply max-key (into [f] someseq))) > to make it do what I wanted > > Is there a better wa

max-key taking a list rather than different number of args

2010-11-14 Thread Tom Hall
Hi, I think a better usage for max-key would be (max-key f someseq) rather than passing the values as args. I used (defn max-key-seq [f someseq] (apply max-key (into [f] someseq))) to make it do what I wanted Is there a better way? Cheers, Tom -- You received this message because you are s