[plt-scheme] Re: syntax-case pattern matching change

From: David Van Horn (dvanhorn at cs.brandeis.edu)
Date: Wed Feb 27 17:36:56 EST 2008

Matthew Flatt wrote:
> At Wed, 27 Feb 2008 16:35:54 -0500, David Van Horn wrote:
>> The semantics of syntax-case pattern matching for dotted patterns 
>> changed going from 372 to 399.  The following example illustrates the 
>> difference:
>>
>> Welcome to MzScheme v372 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
>>  > (syntax-case #'(a b c) ()
>>      [(x ... . y) 'yes]
>>      [_ 'no])
>> no
>>
>> Welcome to MzScheme v3.99.0.13 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
>>  > (syntax-case #'(a b c) ()
>>      [(x ... . y) 'yes]
>>      [_ 'no])
>> yes
>>
>> I'm curious: why was this change made? 
> 
>  http://list.cs.brown.edu/pipermail/plt-scheme/2008-January/022527.html

Ah, thanks!

> As you'll see, I predicted one or two broken macros.
> Did you find one? :)

I wrote one.  See `<clause>' in:

http://planet.plt-scheme.org/package-source/dvanhorn/record-case.plt/1/1/private/check-syntax.ss

Originally I developed the program in v4 and then ported it back to v3 
for backwards compatibility, but my test cases were failing on v3 and 
passing on v4.  I tracked it down and added the needed clause (marked 
with [*]).  In my case, it wasn't so bad, but I could imagine this being 
pretty nasty.

>> Perhaps this deserves an entry in MzScheme_4.txt?
> 
> Good idea -- added.

The mzscheme legacy language has the new behavior.  Do you think it is 
worth having a distinct syntax-case for mzscheme that works as before?

David



Posted on the users mailing list.