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

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.
Ah nice!