chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] case vs. eq? - just curious ....


From: Kon Lovett
Subject: Re: [Chicken-users] case vs. eq? - just curious ....
Date: Fri, 2 Mar 2012 15:59:04 -0800

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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]