Hi,

Am 03.07.2010 um 00:37 schrieb Mike Meyer:

> Cleaning mine version up and combining them gives:
> 
> * Keep it simple and self contained
>  - the first example shouldn't require knowing anything but clojure syntax
>  - the inputs to an example should either be literals or simple expressions
>  - the user shouldn't have to figure out anything but the new concept or type
> * Build up examples cumulatively
>  - each example should introduce at most one new concept
>  - or reinforce the previous example (though that should be kept to a minimum)
>  - or show the function working on a new data type

I would also add:

- exercise edge cases

I'm not sure, but maybe some formal transformation to show the general idea, if 
possible.

(reduce + 0 [1 2 3]) => (+ (+ (+ 0 1) 2) 3).
(map - [1 2 3]) => (-1 -2 -3)
(filter even? [1 2 3]) => (#_1 2 #_3)
(remove even? [1 2 3]) => (1 #_2 3)
(take 2 [1 2 3]) => (1 2 #_3)

With the removed items greyed out, or so. There only one example would be 
sufficient. Just to explain the idea. I'm not sure how useful this would be for 
more complicated functions, though...

Sincerely
Meikel

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