[plt-scheme] combining ... and . in syntax-case patterns

From: Abdulaziz Ghuloum (aghuloum at cs.indiana.edu)
Date: Sat Jan 19 23:01:44 EST 2008

On Jan 19, 2008, at 2:56 PM, Robby Findler wrote:

> But it seems like syntax-case should signal a syntax error for
> patterns like that (altho perhaps there is some interesting reason why
> that's tricky?)

But that pattern does work as expected under both chez and ikarus  
(see below), works under mzscheme for some inputs (first example  
below), and is required to work under R6RS.  So, maybe, it's just a  
small bug somewhere.

Aziz,,,

Welcome to MzScheme v371 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
 > (syntax-object->datum
     (syntax-case #'foo ()
       [([v t] ... . more)
        #'(v ...)]
       [_ (error)]))
()


Petite Chez Scheme Version 7.4
Copyright (c) 1985-2007 Cadence Research Systems

 > (syntax-case #'([x0 y0] [x1 y1]) ()
       [([v t] ... . more)
        #'(v ...)]
       [_ (error)])
(#<syntax x0> #<syntax x1>)


Ikarus Scheme version 0.0.2patched+ (revision 1351, build 2008-01-19)
Copyright (c) 2006-2007 Abdulaziz Ghuloum

 > (syntax-case #'([x0 y0] [x1 y1]) ()
     [([v t] ... . more)
      #'(v ...)]
     [_ (error)])
(#<syntax x0> #<syntax x1>)


Welcome to MzScheme v371 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
 > (syntax-case #'([x0 y0] [x1 y1]) ()
     [([v t] ... . more)
      #'(v ...)]
     [_ (error)])
error: expects at least 1 argument, given 0



Posted on the users mailing list.