Re: Trying to understand clojure evaluation

2010-10-02 Thread swheeler
Andy Thanks. Makes complete sense when explained! Thanks for the speedy reply. On Oct 2, 6:27 pm, Andy Fingerhut wrote: > user> (def a ["a" "a" "a" "b" "c" "c" "a"]) > #'user/a > user> (pack a) > (("a" "a" "a") ("b") ("c" "c") ("a")) > > Now calling (map f (pack a)) will cause the function you

Re: Trying to understand clojure evaluation

2010-10-02 Thread Andy Fingerhut
user> (def a ["a" "a" "a" "b" "c" "c" "a"]) #'user/a user> (pack a) (("a" "a" "a") ("b") ("c" "c") ("a")) Now calling (map f (pack a)) will cause the function you give as the first argument of map to be called with each of the elements of the collection (pack a) in turn. Those elements are,

Trying to understand clojure evaluation

2010-10-02 Thread swheeler
Hi I'm new to Clojure so thought that I would work through some basic examples and decided upon 99 problems (http://aperiodic.net/phil/scala/ s-99/). So far I have got as far as #11 and have become a bit confused as to why my initial solution does not work. My test for this problem is (deftest e

Trying to understand clojure evaluation

2010-10-02 Thread swheeler
Hi I'm new to Clojure so thought that I would work through some basic examples and decided upon the 99 problems (http://aperiodic.net/phil/ scala/s-99/) I have got as far as #11. My test for this is ;p11 (deftest encodemodified-should-return-list-with-counts-when-more-than- one (is (= '((3,"a