Y
Hacker News
new
|
ask
|
show
|
jobs
by
MobiusHorizons
42 days ago
does this mean if you want to add some print statements for local debugging inside a pure function that you will have to remove pure from the whole callgraph? or is there a way to treat it as just a warning?
1 comments
WalterBright
42 days ago
You would have to, which is why D allows code to be prefixed with `debug`, as in:
debug printf("I made it this far before crashing\n");
which turns off the purity checks for the dependent statement.
link
MobiusHorizons
37 days ago
Ah nice!
link