chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Syntax of case expressions


From: Matt Gushee
Subject: [Chicken-users] Syntax of case expressions
Date: Wed, 27 Feb 2008 19:39:19 -0700
User-agent: Thunderbird 2.0.0.9 (X11/20071212)

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/ :




reply via email to

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