[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Preserve keyword in 'syntax-rules' and 'define-syntax-rule'
From: |
Alex Shinn |
Subject: |
Re: [PATCH] Preserve keyword in 'syntax-rules' and 'define-syntax-rule' |
Date: |
Thu, 11 Oct 2012 11:02:57 +0900 |
On Thu, Oct 11, 2012 at 5:41 AM, Ludovic Courtès <address@hidden> wrote:
> Hi,
>
> Mark H Weaver <address@hidden> skribis:
>
>> Unfortunately, preserving the macro keyword breaks one of Oleg
>> Kiselyov's macros, namely 'ppat' in system/base/pmatch.scm:
>
> [...]
>
>> Oleg's macro uses '_' in the keyword position of the pattern, even
>> though '_' is in the literals list. Therefore, it fails to match
>> because 'ppat' does not match that literal.
>
> I would call it a bug in ‘ppat’. However, the real question is how
> frequent that “bug” is. If people have come to rely on the current
> behavior, then it may be more reasonable to stick to it.
This is not a bug. R5RS states:
The keyword at the beginning of the pattern in a <syntax rule> is
not involved in the matching and is not considered a pattern
variable or literal identifier.
R6RS forbids _ as a literal. R7RS retains the R5RS ignoring
of the initial keyword, adds _ as a wildcard, but allows it to be
used as a literal. So this code would only break in R6RS.
--
Alex