This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: unquote-splicing confusion
- From: Per Bothner <per at bothner dot com>
- To: Wen-Chun Ni <wcn at tbcommerce dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Mon, 25 Nov 2002 18:34:40 -0800
- Subject: Re: unquote-splicing confusion
- References: <20021125123235.A26591@tbcommerce.com>
Wen-Chun Ni wrote:
When I wrote some macros for generating a lot of
make-element/make-attribute
code, I found out some of my quasiquote/unquote-splicings just don't
work as I expected. So I check the Dybvig book's example
(let ((a 1) (b 2))
`(,a ,@b))
which should produce (1 . 2).
I ran this through Schemes available to me:
OK: chicken, MIT scheme, scsh (Gambit-C 4.0), Gambit 3.0, SISC, Scheme48
FAIL: Kawa, bigloo, guile, mzscheme (2.02), scm5d6
I also checked CMU CL and Clisp, both return the (1 . 2) answer.
With equal number of OK/FAILs, it's difficult for one to write even
correct Scheme code. My question is: what's the correct behavior
of a conformant Scheme compiler/interpreter?
Either. The code is not valid R5RS Scheme. R5RS states "If a comma
appears followed immediatly by an at-sign (@), then the following
expression must evaluate to a list" which is not the case. Some
extensions allow your code as a non-standard extension; some don't.
Do the implementations that allow it also allow the following:
(append 1 2)
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/