Hi there!
Lets assume I have this map:
user=> (def person {:name "Father" :childs [{:name "Son" :age 10}]})
Testing:
user=> (-> person :childs first)
{:name "Son", :age 10}
Now lets filter the child map:
user=> (def only-name (fn [m] (select-keys m [:name])))
user=> (-> person :childs first only-name)
{:name "Son"}
So why does this not work?:
user=> (-> person :childs first (fn [m] (select-keys m [:name])))
java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't
know how to create ISeq from: Symbol (NO_SOURCE_FILE:59)
Or this?:
user=> (-> person :childs first #(select-keys % [:name]))
java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to
clojure.lang.IPersistentVector (NO_SOURCE_FILE:60)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---