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: Peter Bex
Subject: Re: [Chicken-users] Syntax of case expressions
Date: Thu, 28 Feb 2008 10:34:24 +0100
User-agent: Mutt/1.4.2.3i

On Wed, Feb 27, 2008 at 08:04:23PM -0700, Matt Gushee wrote:
> Wait a minute, though. I understand now why
> 
>    (('a) ...)
> 
> didn't match, but how is it that
> 
>    ('a ...)
> 
> isn't a syntax error? Is it because 'a expands to (quote a), and is thus 
> treated by case as a list of the symbols quote and a? And if so, is that 
> correct behavior? After all,

(case 'quote
  ('a "yes")
  (else "nope")) => "yes"

Expanded:

(case 'quote
  ((quote a) "yes")
  (else "nope")) => "yes"

(Case already quotes for you).

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgptzUi0gnqu7.pgp
Description: PGP signature


reply via email to

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