max doesn't return max?

2012-12-12 Thread Dennis Haupt
maybe i am blind, but why does max return the complete lazy seq here instead of the maximum number? if i just print as-products, i get a list of numbers. (count solution) tells me there are 1000+ and yet max gives me the complete list? (ns euler.Problem8) (def digits

Re: max doesn't return max?

2012-12-12 Thread Timothy Baldridge
(doc max) user= (doc max) - clojure.core/max ([x] [x y] [x y more]) Returns the greatest of the nums. nil max doesn't take a sequence, it takes one or more values and finds the max of them. So use (apply max coll) to get what you want. Timothy On Wed, Dec 12, 2012 at

Re: max doesn't return max?

2012-12-12 Thread Juan Martín Muñoz Facorro
Arguments to *max* should be supplied explicitly. If you want to use a sequence you should use *apply* with *max*: (apply max [1 2 0.5]) Regars, Juan On Wednesday, December 12, 2012 6:12:20 PM UTC-3, HamsterofDeath wrote: maybe i am blind, but why does max return the complete lazy seq here