This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unquote-splicing confusion


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]