Hi, all--

I have just written a 'string-case' macro--it is supposed to behave just like case, except that it uses string=? in place of eqv? as its equality predicate. But in the course of writing test cases, I have encountered a surprise: the Chicken version of case appears to be non-compliant with R5RS.

The spec says

  Syntax: <Key> may be any expression. Each <clause> should have the
    form

  ((<datum1> ...) <expression1> <expression2> ...),

But the syntax implemented in Chicken appears to be

  (<datum> <expression1> <expression2> ...)

E.g.:

csi> (define foo 'a)
csi> (case foo
--->    (('a) 1)
--->    (else 2))
2
csi> (case foo
--->   ('a 1)
--->   (else 2))
1

Or have I misunderstood something?

--
Matt Gushee
: Bantam - lightweight file manager : matt.gushee.net/software/bantam/ :
: RASCL's A Simple Configuration Language :     matt.gushee.net/rascl/ :


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

Reply via email to