equivariant functions

Robert Fraser fraserofthenight at gmail.com
Tue Oct 14 03:46:15 PDT 2008


Andrei Alexandrescu wrote:
> I agree. When considering keyword addition, I think we all should think 
> more about adding contextual keywords, which in the grand D tradition 
> are usually defined as keyword(contextual_keyword).

C++/CLI adds them in quite a few places as long as they could not be 
misinterpreted as identifiers, and still allows them as identifiers in 
places where identifiers would be expected. Of course, it makes writing 
a parser a bit harder (but the technique itself doesn't require semantic 
analysis, so D could use this while maintaining an unambiguous grammar).

For example, the "in" keyword can never occur in an identifier position, 
so it's treated as an identifier if it's in one, and treated as an 
operator if it's seen in a "for each" loop (another cool syntax in the 
language to sneak in a keyword -- note the space).



More information about the Digitalmars-d mailing list