(:b {:b 1}) => 1
("b" {"b" 1}) => same error.
If you want that to work, you need something that creates ({"b" 1} "b") or
(get {"b" 1} "b")
for your example, I believe this works
(-> (hash-map "b" (hash-map :a 3)) (get "b") :a)
Cheers, Jay
On Thu, May 31, 2012 at 10:55 AM, Boris V. Schmid <[email protected]>wrote:
> Can someone tell me what I'm overlooking (clojure 1.4)
>
> (-> (hash-map :b (hash-map :a 3)) :b :a)
> 3
> user> (-> (hash-map "b" (hash-map :a 3)) "b" :a)
> ; Evaluation aborted: java.lang.String cannot be cast to clojure.lang.IFn
>
> I'm not sure why the first can work, and the second cannot. Is it a
> logical limitation of the language, or an oversight in how the macro -> is
> build?
>
> --
> 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
--
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