[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Syntax of case expressions
From: |
Matt Gushee |
Subject: |
Re: [Chicken-users] Syntax of case expressions |
Date: |
Wed, 27 Feb 2008 19:53:20 -0700 |
User-agent: |
Thunderbird 2.0.0.9 (X11/20071212) |
Ivan Raikov wrote:
Remember that in Scheme, (define foo 'a) is a shortcut for
(define (define foo (quote a)))
Well, I can't remember that because I never learned it! And I'm not sure
I understand it now ... have to ponder a bit.
-- 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).
Okay, that part makes sense.
Your first
example should actually be:
(case foo
((a) 1)
(else 2))
Chicken works as expected with that code.
Whoops! So it does. Thanks for the correction.
--
Matt Gushee
: Bantam - lightweight file manager : matt.gushee.net/software/bantam/ :
: RASCL's A Simple Configuration Language : matt.gushee.net/rascl/ :