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

Re: Formal spec; implementation; nesting



And finally, slightly simpler:

 <comment> -> <datum-comment> | <empty-quote> | ; <all-chars-to-eol>

 <datum-comment> -> #; <datum-or-comment>

 <datum-or-comment> -> <datum> | <comment-or-empty>

 <comment-or-empty> -> <datum-comment> | <empty-quote> | <empty>

 <empty-quote> -> '  <comment-or-empty>
                | `  <comment-or-empty>
                | ,  <comment-or-empty>
                | @, <comment-or-empty>


> From: Paul Schlie <schlie@xxxxxxxxxxx>
> Sorry, cut/pasted too quickly:
> 
>  <comment> -> <datum-comment> | <quote-comment> | ; <all-chars-to-break>
> 
>  <datum-comment> -> #; <datum-or-empty>
> 
>  <datum-or-empty> -> <datum> | <datum-comment> | <quote-comment> | <empty>
> 
>  <quote-comment> -> '  <comment-or-empty>
>                   | `  <comment-or-empty>
>                   | ,  <comment-or-empty>
>                   | @, <comment-or-empty>
> 
>  <comment-or-empty> -> <datum-comment> | <quote-comment> | <empty>
> 
> 
>> From: Paul Schlie <schlie@xxxxxxxxxxx>
>> 
>>> From: Alpine Petrofsky <al@xxxxxxxxxxxxx>
>>> 
>>> I encourage anyone who would like to see different behavior
>>> standardized to provide a formal specification of what he desires.
>> 
>> This should do it, and feels somewhat simpler:
>> 
>>  <comment> -> <datum-comment> | ; <all-subsequent-chars-up-to-a-line-break>
>> 
>>  <datum-comment> -> #; <datum-or-comment>
>> 
>>  <datum-or-comment> -> <datum> | <datum-comment> | <empty>
>> 
>> Which should satisfy the following reader scenarios:
>> 
>>  (#; <a> #; '<b>) => ()
>>  (<a> #; #; '<b>) => (<a>)
>>  (#; #; <a> '<b>) => ('<b>)
>>  (<a> '<b> #; #;) => (<a> '<b>)
>> 
>> Where if it's also desired to define what ' ` , mean if applied to <empty>,
>> then comment need only be extended with a definition of <quote-comment>:
>> 
>>  <comment> -> <datum-comment>
>>             | <quote-comment>
>>             | ; <all-subsequent-chars-up-to-a-line-break>
>> 
>>  <quote-comment> -> ' <empty> | ` <empty> | , <empty> | @, <empty>
>> 
>>   (although basically cheating, vs re-writing ' ` , @,  patterns)
>> 
>> Which should satisfy the following further reader scenarios:
>> 
>>  (' #; <a> ') => ()
>>  (' <a> #; ') => ('<a>)
>> 
>> As although quoting <empty>, or commenting <empty> is redundant, there seems
>> no good reason to generate an error; just as quoting a <literal> is also
>> redundant and doesn't generate an error.