On a note related to your example, it would be more idiomatic to
keywords in preference to symbols as keys in your map (e.g., {:hej
"hej" :svejs {:igen "hej2"}}) and literal vectors in preference to
quoted literal lists (e.g., [:svejs :igen]).



On Jul 11, 7:15 am, hsarvell <hsarv...@gmail.com> wrote:
> I seem to suck at searching for information and the api because a
> recursive get should be there already but I can't find it, ie the
> following has probably already been implemented as a macro what will
> be prettier to call but what is it called?:
>
> (defn get2 [el lst]
>    (if (= 1 (count lst))
>       (get el (first lst))
>       (get2 (get el (first lst)) (rest lst))))
>
> (println (get2 {'hej "hej" 'svejs {'igen "hej2"}} '(svejs igen)))

-- 
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

Reply via email to