[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error in the SRFI-30 formal specification



I wrote:

> I think the way to write the specification you intended is like this:
> 
>   <comment> ---> ; <all subsequent characters up to a line break>
>                | <srfi-30-comment>
> 
>   <srfi-30-comment> #| <comment-text> (<srfi-30-comment> <comment-text>)* |#
> 
>   <comment-text> ---> <character sequence not containing #| or |#>

Actually, I think "the way" would be more like this:

  <comment> ---> ; <all subsequent characters up to a line break>
               | <srfi-30-comment>

  <srfi-30-comment> ---> #| <srfi-30-comment-body>* |#

  <srfi-30-comment-body> ---> <character sequence not containing #| or |#>
                            | <srfi-30-comment>

That eliminates the lopsidedness of srfi-30-comment, and also
eliminates the confusing use of parentheses to indicate a BNF grouping
rather than parentheses tokens (which is what they mean throughout
r5rs 7.1).

-al