Comment #2 by lucia.mcojocaru — 2016-12-23T10:34:44Z
Should this issue be marked as resolved?
Comment #3 by jack — 2016-12-23T12:02:29Z
(In reply to Lucia Cojocaru from comment #2)
> Should this issue be marked as resolved?
No because isNumeric doesn't yet work with forward ranges.
Comment #4 by andrei — 2016-12-23T21:16:36Z
I think we should just undocument `isNumeric` and cease enhancing it. It's a terrible function. A simple way to figure out whether something is numeric is simply parse it as a number - the work done is similar and you get the number too.
Comment #5 by jack — 2016-12-23T21:30:00Z
(In reply to Andrei Alexandrescu from comment #4)
> I think we should just undocument `isNumeric` and cease enhancing it. It's a
> terrible function. A simple way to figure out whether something is numeric
> is simply parse it as a number - the work done is similar and you get the
> number too.
1. someone would first need to make sure that every input on isNumeric works with parse
2. and if so we could just make isNumeric forward to parse
That way you don't have to go through the deprecation cycle.
I doubt that parse can handle all of the esoteric inputs that isNumeric can handle right now.
Comment #6 by andrei — 2016-12-23T21:33:49Z
(In reply to Jack Stouffer from comment #5)
> I doubt that parse can handle all of the esoteric inputs that isNumeric can
> handle right now.
That's part of the problem. There's very little use of a function that tells you something is numeric, that is not complemented by a function that tells you what the actual number is.
This function is inspired from scripting languages that need it for logic such as "if it looks like a number, consider it a number". Has no place in D.
Comment #7 by robert.schadek — 2024-12-01T16:27:21Z