Hi,

On Jul 2, 12:18 pm, Walter van der Laan <waltervanderl...@gmail.com>
wrote:

> For example you can point your browser 
> athttp://getclojure.org:8080/examples/reduce
> for reduce examples.

Is it necessary to have >250 examples for a function which has
effectively five variations?

(reduce + [])
(reduce + [1])
(reduce + [1 2 3])
(reduce + 0 [])
(reduce + 0 [1 2 3])

Then there are examples like this one:
(reduce '* '(1 2 3))

Someone who is new to Clojure and tries to understand reduce... Does
he understand why the result is 3? A result which relies on a not very
well-known fact, that you can actually call symbols like keywords for
map lookup with up to two arguments. (I bet there quite a few of
"seasoned" clojurians who didn't know that) I - if I was a newbie to
the language - would mainly think: wtf? Additionally the particular
example above doesn't even make sense.

I'm all for examples, but please: clear examples focusing on the thing
being demonstrated. Symbol calling or showing that [1 2 3] and (list 1
2 3) can be interchanged in the example above are nice to know, but
don't help to understand reduce itself. They should go to their own
sections in a tutorial.

The 0.02€ of a guy who has not put effort in creating examples for the
core API.

Sincerely
Meikel

PS: I also think the examples should demonstrate idiomatic clojure. [1
2 3] is idiomatic while '(1 2 3) is not. Whatever we put in examples
will show up in code. So be it [] vs. '() or (.java interop) vs. (.
interop (java)) - we should pay attention!

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to