[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] What happened to (UNQUOTE <expression> ...)
On Tue, 3 May 2011, Peter Bex wrote:
> On Tue, May 03, 2011 at 02:56:31PM +0900, Andrzej wrote:
>> The question is whether we want to do it at all. Note that e.g.
>> ``,,@(list) and ``,@,@(list) both expand into forms that are illegal
>> when expanded again. Perhaps that's not a big issue but is not a
>> particularly elegant design.
>
> Agreed. This also bothered me about the design.
Note that Al* Petrofsky proposed a different solution that does not
involve unquote lists, and that some may find more elegant.
>From his post here:
http://www.rhinocerus.net/forum/lang-scheme/98742-quasiquote-syntax-rules-macro.html
> One way to
> make scheme compatible with common lisp would be to add the following
> to r5rs:
> When a comma at-sign and the expression that follows it are being
> replaced by the elements of the list that resulted from the
> expression's evaluation, any sequence of commas and comma at-signs
> that immediately preceeded the comma at-sign is also removed and is
> added to the front of each of the replacements.
> (let ((x '(a b c))) ``(,,x ,@,x ,,@x ,@,@x))
> => `(,(a b c) ,@(a b c) ,a ,b ,c ,@a ,@b ,@c)
> ``(,,@'() ,@,@(list))
> => `()
> `````(a ,(b c ,@,,@,@(list a b c)))
> => ````(a ,(b c ,@,,@a ,@,,@b ,@,,@c))
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports