[plt-scheme] BUG in case

From: Saint Katsmall T. Wise, Esquire (kela_bit at netvision.net.il)
Date: Thu Jun 26 00:10:12 EDT 2003

Robby Findler wrote:

>At Thu, 26 Jun 2003 03:22:05 +0000, "Saint Katsmall T. Wise, Esquire" wrote:
>  
>
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>>This bug has been driving me crazy all day and I just found out it's not 
>>a bug in my code :\
>>I have two variables: green-char and c. They are both set to #\012, 
>>which incidentally is a newline.
>>Thus, they are eqv? indeed as the example shows.
>>However, case does not recognize them to be the same (although it is 
>>supposed to use eqv?)
>>
>> > (eqv? green-char c)
>>#t
>> > (case c [(green-char) 'a] [else 'b])
>>b
>>
>>Is this indeed a bug?
>>    
>>
>
>No -- case implicitly quotes its argument; you probably want either
>this:
>
>  (cond 
>    [(eqv? c green-char) 'a]
>    [else 'b])
>
>or
>
>  (case c [(#\012) 'a] [else 'b])
>
>Robby
>
I see. Well then how would I user a variable using case? Is this possible?
For these are settings that can and probably will be changed quite a lot.

>PS: congrats on your sainthood.
>  
>
Thanks. Was hard enough to achieve.

Yours truly,
Saint Katsmall T. Wise, Esquire

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20030626/e8bf28ac/attachment.html>

Posted on the users mailing list.