[Issue 15526] provide a way to ignore underscores for parsing integers

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 7 12:32:50 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15526

--- Comment #2 from Steven Schveighoffer <schveiguy at yahoo.com> ---
The consensus seems to have been that parse isn't the right place to put this
at all, but rather create a new function that deals with parsing D integers
(which can have underscores).

TBH, I don't think the runtime variable was a forethought, just a way to modify
the function so that it behaved like the original for existing calls. Sure, a
template parameter would work better, but also remember that precedent has
things like radix being a runtime parameter.

In any case, having a separate function solves the backwards compatibility
problem, and is as effective as a template parameter. But I don't know whether
it's worth a whole new function for it.

Runtime parameter, template parameter, or new function name, this functionality
should be somewhere in the library IMO.

--


More information about the Digitalmars-d-bugs mailing list