Oh, thank you all for the (prompt!) reminder, I had forgotten about that.<br>Match works as expected indeed.<br><br><br>Laurent<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 19, 2012 at 2:15 PM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">case compares with eqv?<br>
<br>
strings are only ever eqv? if they are eq?<br>
<br>
It turns out that Racket guarantees that all literal strings in your<br>
program are eq if they have the same letters, so in your program, the<br>
three "a"s are all the same object.<br>
<br>
When you append the empty string to the end, you get a new object, so<br>
it isn't eqv with the other three.<br>
<div class="im HOEnZb"><br>
On Mon, Nov 19, 2012 at 6:07 AM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br>
</div><div class="HOEnZb"><div class="h5">> Hi,<br>
><br>
> Is this a bug or a not quite intuitive normal behavior?<br>
>> (define (foo s)<br>
> (case s<br>
> [("a") 'a]<br>
> [else 'none]))<br>
>> (foo "a")<br>
> 'a<br>
>> (foo (string-append "a" ""))<br>
> 'none<br>
><br>
> in 5.3.1.5--2012-11-08(5589bcb/a) [3m].<br>
><br>
> Laurent<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
</font></span></blockquote></div><br></div>