develooper Front page | perl.perl5.porters | Postings from July 2009

Re: Is unicore/lib/gc_sc/Digit.pl documented anywhere?

Thread Previous | Thread Next
From:
karl williamson
Date:
July 25, 2009 13:41
Subject:
Re: Is unicore/lib/gc_sc/Digit.pl documented anywhere?
Message ID:
4A6B6DDE.5090805@khwilliamson.com
Chas. Owens wrote:
> Is it safe to say
> 
> use Unicode::Digits qw/digits_to_int/;
> 
> my @digits;
> for (split "\n", require "unicore/lib/gc_sc/Digit.pl") {
>         my ($s, $e) = map hex, split;
>         for (my $ord = $s; $ord <= $e; $ord++) {
>                 my $chr = chr $ord;
>                 push @{$digits[digits_to_int $chr]}, $chr;
>         }
> }
> 
> for my $i (0 .. 9) {
>         my $re = join '', "[", @{$digits[$i]}, "]";
>         $digits[$i] = qr/$re/;
> }
> 
> Or is unicore/lib/gc_sc/Digit.pl an undocumented feature likely to change?
> 

Any file in unicore/lib is subject to change or removal, as the comments 
being added to each in 10.1 indicate.  You could use the file 
To/Digit.pl which is also undocumented, but I know of no plans to change it.

But, I'm working on a patch which will expose the Numeric_Value 
property, so that it becomes trivial to say /\p{nv=3}/ to accomplish 
what you said you want.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About