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

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to