Jin S. Choi | 13 Jan 14:32 1997

case w/ rational number failure


Case fails when the key is an expression that evaluates to a rational
number. This is with scheme48 as used in scsh 0.4 (s48 0.36).

> (case 1/8 ((1/8) #t) (else #f))
#t
> (case (string->number "1/8") ((1/8) #t) (else #f))
#f

The ,expand command shows:
> ,expand (case (string->number "1/8") ((1/8) #t) (else #f))
'((lambda (temp) (cond ((eq? temp '1/8) #t) (else #f))) (string->number "1/8"))

That should be eqv?, according to R4RS.


Gmane