chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] quoted vectors in syntax rules


From: Peter Bex
Subject: Re: [Chicken-users] quoted vectors in syntax rules
Date: Fri, 2 Mar 2012 12:29:13 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Mar 02, 2012 at 10:23:56AM +0100, Sandra Snan wrote:
> I stumbled upon the following behavior:
> 
> (equal? '#(a b c) (vector 'a 'b 'c))
> (define (f-test)
>  '#(a b c))
> (define-syntax s-test
>  (syntax-rules ()
>    ((test)
>     '#(a b c))))
> 
> (f-test)
> (s-test)
> 
> (equal? (f-test) (s-test))
> 
> What is the explanation for this puzzle?

Which version of Chicken are you using?  I can't reproduce
this with 4.7.0 or the current master, and I know older versions had
some problems with stripping the syntax information off macro-renamed
symbols.

Try printing the result directly instead of comparing it.  In 4.5.0,
I get this:

#;1> (define-syntax s-test (syntax-rules () ((test) '#(a b c))))
#;2> (s-test)
#(a30 b31 c32)

The easiest solution is to upgrade.

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



reply via email to

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