Re: [Scheme-reports] R7RS final (draft #10?) - question for section 4.3.2 Pattern language and 7.1.5 Transformers Joseph Wayne Norton (21 Aug 2013 07:33 UTC)

Re: [Scheme-reports] R7RS final (draft #10?) - question for section 4.3.2 Pattern language and 7.1.5 Transformers Joseph Wayne Norton 21 Aug 2013 07:33 UTC

Oops … I forgot to add the pattern identifier to the updated grammar.

> diff --git a/spec/syn.tex b/spec/syn.tex
> index a620f91..5fc9662 100644
> --- a/spec/syn.tex
> +++ b/spec/syn.tex
> @@ -381,7 +381,12 @@ un\-quo\-ta\-tion $D$} takes precedence.
>  \> (syntax-rules (\arbno{\meta{identifier}}) \arbno{\meta{syntax rule}})
>  \> \| (syntax-rules \meta{identifier} (\arbno{\meta{identifier}})
>  \> \> \ \ \arbno{\meta{syntax rule}})
> -\meta{syntax rule} \: (\meta{pattern} \meta{template})
> +\meta{syntax rule} \: (\meta{srpattern} \meta{template})
> +\meta{srpattern} \: (\meta{pattern identifier} \arbno{\meta{pattern}})
> +\>  \| (\meta{pattern identifier} \arbno{\meta{pattern}} . \meta{pattern})
> +\>  \| (\meta{pattern identifier} \arbno{\meta{pattern}} \meta{pattern} \meta{ellipsis} \arbno{\meta{pattern}})
> +\>  \| (\meta{pattern identifier} \arbno{\meta{pattern}} \meta{pattern} \meta{ellipsis} \arbno{\meta{pattern}}
> +\> \> \ \ . \meta{pattern})
>  \meta{pattern} \: \meta{pattern identifier}
>  \>  \| \meta{underscore}
>  \>  \| (\arbno{\meta{pattern}})
>

Thanks.

Joe N.

On 2013/08/21, at 12:18, Joseph Wayne Norton <norton@lovely.email.ne.jp> wrote:

>
> Ok, I understand.
>
> If the grammar was to be updated, would something like the following be correct?
>
>> $ git diff -w -U
>> diff --git a/spec/syn.tex b/spec/syn.tex
>> index a620f91..a253a77 100644
>> --- a/spec/syn.tex
>> +++ b/spec/syn.tex
>> @@ -381,7 +381,12 @@ un\-quo\-ta\-tion $D$} takes precedence.
>> \> (syntax-rules (\arbno{\meta{identifier}}) \arbno{\meta{syntax rule}})
>> \> \| (syntax-rules \meta{identifier} (\arbno{\meta{identifier}})
>> \> \> \ \ \arbno{\meta{syntax rule}})
>> -\meta{syntax rule} \: (\meta{pattern} \meta{template})
>> +\meta{syntax rule} \: (\meta{srpattern} \meta{template})
>> +\meta{srpattern} \: (\arbno{\meta{pattern}})
>> +\>  \| (\atleastone{\meta{pattern}} . \meta{pattern})
>> +\>  \| (\arbno{\meta{pattern}} \meta{pattern} \meta{ellipsis} \arbno{\meta{pattern}})
>> +\>  \| (\arbno{\meta{pattern}} \meta{pattern} \meta{ellipsis} \arbno{\meta{pattern}}
>> +\> \> \ \ . \meta{pattern})
>> \meta{pattern} \: \meta{pattern identifier}
>> \>  \| \meta{underscore}
>> \>  \| (\arbno{\meta{pattern}})
>>
>
>
> Thanks.
>
> Joe N.
>
> On 2013/08/21, at 0:57, John Cowan <cowan@mercury.ccil.org> wrote:
>
>> Joseph Wayne Norton scripsit:
>>
>>> For R7RS final (draft #10?), the definition of the <pattern> grammar
>>> in section 7.1.5 Transformers does not match with the explanation
>>> given in section 4.3.2 Pattern language.  Is this an intentional loose
>>> definition of <pattern> or a bug with the definition of <pattern> ?
>>
>> It's inherited from R5RS.  It's definitely correct that the top-level
>> pattern has to be a list pattern, not a vector pattern or an identifier
>> pattern, because that couldn't match the source code.  R6RS gives a more
>> restricted syntactic definition of a top-level pattern, but we missed
>> transcribing that into R7RS-small.
>>
>> I don't think it's a serious error: the prose often sets further limits
>> on what 7.1 permits.
>>
>> --
>> Note that nobody these days would clamor for fundamental laws        John Cowan
>> of *the theory of kangaroos*, showing why pseudo-kangaroos are   cowan@ccil.org
>> physically, logically, metaphysically impossible.    http://www.ccil.org/~cowan
>> Kangaroos are wonderful, but not *that* wonderful.     --Dan Dennett on zombies
>
>
> _______________________________________________
> Scheme-reports mailing list
> Scheme-reports@scheme-reports.org
> http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports