DIP 1026---Deprecate Context-Sensitive String Literals---Community Review Round 1

Walter Bright newshound2 at digitalmars.com
Wed Dec 4 22:57:21 UTC 2019


On 12/4/2019 5:35 AM, Timon Gehr wrote:
> On 04.12.19 12:10, Dennis wrote:
>>
>>
>> Now my proposed next one is:
>>
>> - Small feature: context-sensitive string literals
>>    Small problem: accidentally bumps the complexity class of D's lexical grammar.
> 
> A small fix for this small problem is to just say in the specification that 
> heredoc identifiers may not exceed 1e100 characters. ;)
> 
> Another fix could be to just go over the language specification and replace all 
> wrongly applied CS terms by a short explanation of what is actually going on. 

Another case of my lack of academic CS training showing. I would appreciate it 
if qualified people would indeed go through the D spec and correct misuse of the 
terms.

I know Timon likes to excoriate my conflation of "assert" and "assume", which 
have precise CS definitions. I'm sure there's plenty more in the spec.

 > (In practice, when Walter says D's grammar is context-free, what he means is
 > that parsing does not depend on semantic analysis on a prefix of the code, a
 > property that C++ has which implies context-sensitivity and is usually
 > abbreviated this way, and Walter's aim was to contrast D to this.)

That's right. I often express it in even simpler (but less precise) terms - a 
symbol table is not required to parse it. Yes, I know the pedant will point out 
that heredoc has a symbol table with exactly one symbol in it, but please, allow 
me to concede that in advance and spare us :-)


More information about the Digitalmars-d mailing list