[plt-scheme] quasiquote?

From: Doug Orleans (dougo at place.org)
Date: Sat Jan 10 00:49:33 EST 2004

Ken Anderson writes:
 > I now see that args must be a list, which i assume means a proper list.
 > 
 > At 11:37 AM 1/7/2004 -0500, Ken Anderson wrote:
 > >> (define name 'sscanf)
 > >> (define args '(string format-string . args))
 > >> `(,name . ,args)
 > >(sscanf string format-string . args)
 > >> `(,name , at args)
 > >. append: expects argument of type <proper list>; given (string format-string . args)
 > >>
 > >
 > >>From my experience with Common Lisp i expected the two quasiquote expressions to print the same.   Am i doing somethine wrong in Scheme or is this a bug?
 > >I'm using  200alpha12 (iteration 0)

Coincidentally, I just ran into the same limitation: unquote-splicing
only works on proper lists.  (Actually the one I ran into was
unsyntax-splicing.)  R5RS only says its argument "must evaluate to a
list", but it doesn't say proper list-- or is this always implied by
the spec?  Anyway, is there a good reason not to extend it to work on
improper lists as well?

Speaking of improper lists, I converted my code to use MzLib's
plt-match.ss instead of match.ss, and had to do some kludging to deal
with the separate "list" vs. "list-rest" patterns.  Is there a good
reason to separate these, rather than just have a single "list"
pattern whose argument is allowed to be an improper list?

--dougo at place.org


Posted on the users mailing list.