On 5/12/17 10:10 AM, Meta wrote:
On Friday, 12 May 2017 at 13:50:50 UTC, ixid wrote:
I think the word dump would be too confusing for users based on the
history of the term in C. It should be writeFormattedVariableLn.
/sarcasm.
Just parodying the frankly ridiculous response to 'print'.
In all seriousness, debugPrint or something similar might be a more
informative name.
Otherwise, I like the functionality. I've written my own version of dump
before in a couple projects and it'd be nice to have it in Phobos. Also
as Andrea said, does `debug` obviate the need for dump to be @nogc
nothrow @safe? Does the following work?
void test(int x) @nogc nothrow @safe pure
{
debug dump!x();
}
AFAIK, debug only affects pure. You can call non-pure functions inside a
debug block while inside a pure function.
-Steve