That makes sense. Thanks for the help.

Also say I wanted to get both eye-colour and hair-colour.
Could that be done by (-> human2 :char [:eye-colour :hair-colour])?


On Tuesday, 22 November 2016 11:08:45 UTC, Bost wrote:
>
> (->> human2 :char :eye-colour) or 
> (-> human2 :char :eye-colour) or 
> ((human2 :char) :eye-colour) or 
> (:eye-colour (:char human2)) all variants work. 
>
> Either way it looks like you're asking a very basic question. 
> I recomend you to go over http://clojurekoans.com/ or read some 
> tutorial, quick start guide etc. 
>
>
> 2016-11-22 11:42 GMT+01:00 'Rickesh Bedia' via Clojure 
> <clo...@googlegroups.com <javascript:>>: 
> > Lets say I have: 
> >     (def human {:firstname "John" :surname "Smith"}) 
> > To get the firstname I would run (human :firstname) and this would give 
> > "John" 
> > 
> > However if I now have 
> >     (def human2 {:name "Bob" :char {:eye-colour "brown" :hair-colour 
> > "red"}}) 
> > how would I get the eye-colour? Would it be (human2 :char :eye-colour). 
> I 
> > just want the eye-colour 
> > 
> > Thanks in advance 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> <javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com <javascript:> 
> > 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 clojure+u...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to