On Tue, Dec 14, 2010 at 1:09 PM, Per Bothner <p...@bothner.com> wrote:
> On 12/14/2010 09:48 AM, Sam Tobin-Hochstadt wrote:
>>
>> On Tue, Dec 14, 2010 at 12:45 PM, Per Bothner<p...@bothner.com>  wrote:
>>>
>>> I was thinking in terms of the patterns based on:
>>>
>>>
>>> http://download.plt-scheme.org/doc/372/html/mzlib/mzlib-Z-H-27.html#node_chap_27
>>
>> That documentation is very old, from December 2007.  The current
>> documentation for `match' is here:
>>
>>   http://docs.racket-lang.org/reference/match.html
>
> I was deliberately linking to the "very old" documentation,
> because it has the property that (var1 var2 var3) is a valid
> pattern matching a 3-element list.  If I'm reading the newer
> documentation right, it requires you to write (list var1 var2 var3),
> which seems highly undesirable for a standard (built-in)
> pattern language, and is incompatible with syntax-rules.

You are reading the documentation correctly.  The documentation for
the legacy behavior is here:
  http://docs.racket-lang.org/mzlib/mzlib_match.html

However, I think that the newer syntax is better.  First, symmetry
between lists and other data structures is a good idea.  Second,
requiring `list' makes the syntax extensible.  For example, in Racket
currently, structure patterns can be used simply with the constructor
name.  In the old syntax, that would be ambiguous.  Additional, Racket
support extensible pattern matching, which would again be ambiguous.

Finally, there's no reason that this couldn't be implemented with
`syntax-rules' and there's no reason for this to be a design concern
given that R6RS supports procedural macros.
-- 
sam th
sa...@ccs.neu.edu

_______________________________________________
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to