On Mar 2, 2012, at 3:52 PM, Matt Welland wrote:

> I expected this to work:
> 
> (define (comp->text comp)
>   (case comp
>    ((=)    "=")
>    ((>)    ">")
>    ((<)    "<")
>    ((>=)  ">=")
>    ((<=)  "<=")
>    (else "unk")))
> 
> But had to convert to a cond with (eq? comp =) etc...

Are =, >, etc variables? 'case' quotes the objects in each "case". So comparing 
against symbols.

(##core#let
  ((tmp '=))
  (##core#if
    (or (eqv? tmp '=))
    (##core#begin "=")
    (##core#if
        ...

> 
> I thought case was supposed to use eq? to do the compare?

eqv?

> 
> Thanks,
> 
> M a t t
> -=-
> _______________________________________________
> Chicken-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/chicken-users


_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to