debug a reserved keyword (even for enums?)

Walter Bright newshound2 at digitalmars.com
Sun Apr 12 19:55:13 UTC 2026


What you're suggesting is that `debug` be a context sensitive keyword.

D has some context sensitive keywords, such as:

```
extern (C) ...
pragma(msg,...)
__traits(isReg,...)
scope (exit)
```

But these are tightly constrained cases where they happen. If `debug` were 
contest sensitive, you can have problematic sequences like:
```
debug (foo(3));
```

Is `debug` a function call or a debug statement? It's ambiguous.

It's better to keep the ambiguous syntaxes to a minimum. Don't want to be like 
C/C++ where a correct parse requires a symbol table.


More information about the Digitalmars-d mailing list