The fact that the first one works at all should probably be considered a bug. The syntax of case here:<div><br></div><div><a href="http://docs.racket-lang.org/reference/case.html?q=case#(form._((lib._racket/private/more-scheme..rkt)._case))">http://docs.racket-lang.org/reference/case.html?q=case#(form._((lib._racket/private/more-scheme..rkt)._case))</a></div>
<div><br></div><div>dictates that the constants in a case clause be parenthesized.</div><div><br></div><div>The more important issue, however, is that the constants are implicitly quoted by the case form. So, when you explicitly quote them, they're double quoted. You're trying to match 'a against ''a.</div>
<div><br></div><div>-Jon</div><div><br><br><div class="gmail_quote">On Mon, Sep 17, 2012 at 6:47 PM, Kieron Hardy <span dir="ltr"><<a href="mailto:kieron.hardy@gmail.com" target="_blank">kieron.hardy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br><br>Can anyone explain why the first function below selects 'x1-case as expected but the second fails to select 'x2-case? Am I expecting something to happen that shouldn't?<br>
<br>Thanks,<br><br>Kieron.<br>
<br>****<br><br>#lang racket<br><br>(case 'a<br> ['a 'x1-case]<br> ['b 'x1-case]<br> [(15 2 3) 'y1-case]<br> [(10 11 12) 'z1-case])<br><br>(case 'a<br> [('a 'b) 'x2-case]<br>
[(15 2 3) 'y2-case]<br> [(10 11 12) 'z2-case])<br><br>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>