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 =
Hi again,
Am 02.07.2009 um 19:52 schrieb Meikel Brandmeyer:
(defn match [prev-char next-char]
(cond = prev-char
Typo: you mean cond*p* instead of cond.
\( (= next-char \))
\[ (= next-char \])
true false))
And BTW: the true shouldn't be there. If there
is an odd number of clauses,
On Jul 2, 2009, at 1:48 PM, Mark Volkmann wrote:
(defn match [prev-char next-char]
(cond = prev-char
\( (= next-char \))
\[ (= next-char \])
true false))
It looks like you intended condp here instead of cond.
Your test works as expected if you make that change. However, there's