numericValue for (unicode) characters

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jan 4 16:45:29 PST 2013


On Fri, Jan 04, 2013 at 11:48:39PM +0100, monarch_dodra wrote:
[...]
> Sounds like the root of the problem is that isNumber !=
> Numeric_Type[Decimal, Digit, Numeric]
> 
> Ergo, there is no correlation between isNumber and numericValue.

Yikes. That's pretty ... nasty. :-(


> Feels like there is a lot missing from std.uni, but at the same
> time, unicode is really huge.

Yeah, Unicode is a lot more complex than most people realize. Recently I
read through TR14 (proper line-breaking in Unicode), and I was gaping in
awe at the insane complexity of such a seemingly-simple task.


> At the very least, I think we should have Category enum, along with a
> (get) "category" function.

Yes! We need that!!


> I was just saying to jmdavis in the pull that std.ascii had
> "isDigit", but that uni didn't. In truth, both also lack isDecimal
> and isNumeric.
> 
> There would just be a bit of ambiguity now between the broad
> "isNumeric", and "all the chars that have a numeric value"... :/
> 
> Damn. Unicode is complicated.
[...]

I, for one, would love to know why isNumeric != hasNumericValue.


T

-- 
Valentine's Day: an occasion for florists to reach into the wallets of
nominal lovers in dire need of being reminded to profess their
hypothetical love for their long-forgotten.


More information about the Digitalmars-d mailing list