Skip to content

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

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

khwilliamson
Copy link
Contributor

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.

  • This set of changes does not require a perldelta entry.

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
Copy link
Contributor

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.
Copy link
Contributor

@jkeenan jkeenan left a 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.)

@khwilliamson
Copy link
Contributor Author

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 UCD.t. The ones for New Tai Lue, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants