The following short code snippet compares character literals.
The match function is suppose to return true when given the characters
( and ) or [ and ]. It should return false for everything else.
Why is the output of this code "(" instead of "true"?

(defn match [prev-char next-char]
  (cond = prev-char
    \( (= next-char \))
    \[ (= next-char \])
    true false))

(println (match \( \)))

-- 
R. Mark Volkmann
Object Computing, Inc.

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