I noticed that http://clojure-examples.appspot.com/clojure.core/max has both
(apply max [1 2 3 4]) - 4 and (max []) - [] (which I think is a poor
example).
However, when attempting to add another example for (apply max []) which I
expected to return nil, that instead it throws an exception.
I
Once you walk down the path of What should (max) return? I think you won't
want a default behavior.
Stu
P.S. Agreed that (max []) is a bad example.
I noticed that http://clojure-examples.appspot.com/clojure.core/max has both
(apply max [1 2 3 4]) - 4 and (max []) - [] (which I think is a
On Fri, 9 Jul 2010 13:57:05 -0400
Stuart Halloway stuart.hallo...@gmail.com wrote:
Once you walk down the path of What should (max) return? I think you won't
want a default behavior.
Stu
P.S. Agreed that (max []) is a bad example.
Given that max only works on numbers, then why doesn't
Given that max only works on numbers, then why doesn't (max []) throw
the same exception as (max [] [])? Or, for that matter, (max \a) throw
the same exception as (max \a \b \c)?
Clojure tends not to guarantee any particular behavior for invalid
inputs. It might return an error, or it might