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
(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
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