digitalmars.D.learn - dmd debug(level) Is it obsolete?
- Brother Bill (32/32) Aug 17 Page 462 of book: Programming in D
- Richard (Rikki) Andrew Cattermole (2/2) Aug 17 That was removed a while back.
- Nick Treleaven (3/10) Aug 17 Yes, for rationale see:
Page 462 of book: Programming in D
This won't compile. Is this obsolete?
```
app.d(8,8): Error: identifier expected inside `debug(...)`, not
`1`
debug(1) writeln("entered myFunction");
^
source\app.d(10,8): Error: identifier expected inside
`debug(...)`, not `2`
debug(2) {
^
Error C:\D\dmd2\windows\bin64\dmd.exe failed with exit code 1.
```
source/app.d
```
debug import std.stdio;
void main() {
myFunction("deneme.txt", [10, 4, 100]);
}
void myFunction(string fileName, int[] values) {
debug(1) writeln("entered myFunction");
debug(2) {
writeln("the arguments:");
writeln(" file name: ", fileName);
foreach (i, value; values) {
writefln(" %4s: %s", i, value);
}
}
// ... the implementation of the function ...
}
```
Aug 17
That was removed a while back. https://github.com/dlang/dmd/pull/20713
Aug 17
On Sunday, 17 August 2025 at 14:59:00 UTC, Brother Bill wrote:
Page 462 of book: Programming in D
This won't compile. Is this obsolete?
```
app.d(8,8): Error: identifier expected inside `debug(...)`, not
`1`
debug(1) writeln("entered myFunction");
^
Yes, for rationale see:
https://dlang.org/changelog/2.101.0.html#dmd.deprecate_version_int
Aug 17









"Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> 