You do mean keywords rather than symbols, right? A symbol would be
'hello. A keyword is :hello.
The ruby name for the clojure keyword concept is "symbol". I used to
get the terminology backwards because of that.

(assert (= (name :hello) "hello"))
(assert (= :hello (keyword "hello")))

On Apr 13, 2:34 pm, strattonbrazil <strattonbra...@gmail.com> wrote:
> I want to map a dictionary and do different things depending on the
> key.  I was planning on using an if-clause, but I'm not sure how to
> compare symbols to strings.
>
> Something like
>
> (map (fn [k v] (if (== k "hello") ... ...) {:hello 1 :goodbye 2})
>
> How would I normally compare symbols and strings?

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to