(get book :authors) is saying "return the value of the ":authors" key in
the "book" map. You provided {:title... :authors [octavia]} as the "book"
map, the value of "authors" being a vector with a single element. That
single element being "{:name "Octavia E. Butler"
:birth-year 1947
:death-year 2006}"
In other words, it is all working correctly.
Did you mean (old-book->new-book {:title "Wild Seed", :authors (:name
octavia)}) ?
On Monday, 27 October 2014 13:45:45 UTC, Roelof Wobben wrote:
>
> Hello,
>
> I have this "facts".
>
> (def octavia {:name "Octavia E. Butler"
> :birth-year 1947
> :death-year 2006})
>
>
> (def wild-seed {:title "Wild Seed", :authors [octavia]})
>
>
>
> So I thought when I do this :
>
>
> (defn old-book->new-book [book]
> (get book :authors))
>
>
> (old-book->new-book {:title "Wild Seed", :authors [octavia]})
>
>
> I see this output : [{:death-year 2006, :name "Octavia E. Butler",
> :birth-year 1947}]
>
> where I expected it to be octavia or octavia E. Butler
>
>
> Can someone explain why I see the wrong output ?
>
>
> Roelof
>
>
>
>
> But I see this output :
>
>
--
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.