Corner cases in Primary Type Syntax and its proof-of-concept implementation

Tim tim.dlang at t-online.de
Fri Oct 11 20:00:30 UTC 2024


On Friday, 11 October 2024 at 18:19:01 UTC, Quirin Schroll wrote:
> Walter convinced me that the implementation limits the 
> flexibility of future scope guards. I suggested that if 
> *Tokens* is exactly one identifier (or one single token), it 
> could be a scope guard (and be an error if it’s not a valid 
> scope guard), otherwise a `BasicType` (and be an error if it 
> isn’t).
>
> This is for two reasons: No-one on the meeting could imagine a 
> scope guard that cannot be a single identifier (or keyword if 
> need be) and in that case, if a type clashed with a scope 
> guard, removing the parentheses around the token would always 
> work as the types that require parentheses to express with this 
> DIP are always longer than one token.

A future scope guard could need extra parameters. For example, 
here was a suggestion for `scope (failure, 
ExceptionSpecification)`: 
https://forum.dlang.org/thread/mailman.723.1427369014.3111.digitalmars-d@puremagic.com#post-mailman.723.1427369014.3111.digitalmars-d:40puremagic.com



More information about the Digitalmars-d mailing list