chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Syntax of case expressions


From: Ivan Raikov
Subject: Re: [Chicken-users] Syntax of case expressions
Date: Thu, 28 Feb 2008 11:49:14 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

  Oops, I meant that (define foo 'a) -> (define foo (quote a)).

    -Ivan

Ivan Raikov <address@hidden> writes:

>   Remember that in Scheme, (define foo 'a) is a shortcut for 
> (define (define foo (quote a))) -- quote is a special form, and not
> a part of the literal. So you in your case statement you are not
> matching the symbol a, you are actually matching the symbol 'a (the
> apostrophe is treated as a literal in the case statement). Your first
> example should actually be: 
>
> (case foo
>   ((a) 1)
>   (else 2))
>
> Chicken works as expected with that code. 
>
>   -Ivan




reply via email to

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