-
Notifications
You must be signed in to change notification settings - Fork 577
Unicode:UCD Clarify pod for num() #23007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: blead
Are you sure you want to change the base?
Conversation
lib/Unicode/UCD.pm
Outdated
Because these do not follow modern decimal positional notation, stringing more | ||
than one of these together doesn't mean what you likely would think it means. | ||
So, C<num> correctly returns C<undef> if you try. If you add a second | ||
parameter to get returned to you the initial legal numeric length, it returns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add a second parameter to get returned to you the initial legal numeric length it returns indicating that to get a numeric value you'd have to stop after just the first character in the string.
This is pretty clumsy.
Maybe:
If you request the length of the valid initial substring in this case, that length would be one, since only the first character represents a valid numeric value.
though I'm not entirely happy with that either.
Add example of how it handles numbers that aren't decimal positional. I thought it would clarify things to expand and correct the flawed example pointed out in GH Perl#23003.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add some unit tests to lib/Unicode/UCD.t
(or some other file) to demonstrate the code added to the POD? (I couldn't find a .t
file that contained a match for m/RUMI/t
.)
This is a documentation PR only. I chose Rumi because I had recently researched it, and the details were fresh in my mind. There are tests for similar situations already in |
Add example of how it handles numbers that aren't decimal positional.
I thought it would clarify things to expand and correct the flawed example pointed out in GH #23003.