Skip to content

Commit 112ad2e

Browse files
committed
Add documentation on uniprops and update uniprop
to say it returns a Bool for Boolean Unicode properties
1 parent fe2a8bb commit 112ad2e

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

doc/Type/Cool.pod6

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -858,21 +858,36 @@ C<$pattern> is applied to the remaining characters of C<$string>.
858858
say "perL 6".samecase("A__a__"); # Perl 6
859859
say "pERL 6".samecase("Ab"); # Perl 6
860860
861-
=head2 method uniprop
861+
=head2 routine uniprop
862862
863863
Defined as:
864864
sub uniprop(Str(Cool), |c)
865-
method uniprop(|c)
865+
sub uniprop(Int:D $code, Stringy:D $propname)
866+
sub uniprop(Str, $propname, Stringy:D $propname)
867+
method uniprop(|c) { uniprop(self, |c)
866868
867869
Interprets the invocant as a L<Str|/type/Str>, and returns the
868870
L<unicode property|http://userguide.icu-project.org/strings/properties> of the first
869871
character. If no property is specified returns the
870872
L<General Category|https://en.wikipedia.org/wiki/Unicode_character_property#General_Category>.
873+
Returns a Bool for Boolean properties.
871874
872875
say 'a'.uniprop; # Ll
873876
say '1'.uniprop; # Nd
874-
say 'a'.uniprop('Alphabetic'); # 1
875-
say '1'.uniprop('Alphabetic'); # 0
877+
say 'a'.uniprop('Alphabetic'); # True
878+
say '1'.uniprop('Alphabetic'); # False
879+
880+
=head2 routine uniprops
881+
882+
Defined as:
883+
sub uniprops(Str:D $str, Stringy:D $propname = "General_Category")
884+
885+
Interprets the invocant as a L<Str|/type/Str>, and returns the
886+
L<unicode property|http://userguide.icu-project.org/strings/properties> for each character
887+
as a Seq. If no property is specified returns the
888+
L<General Category|https://en.wikipedia.org/wiki/Unicode_character_property#General_Category>.
889+
Returns a Bool for Boolean properties. Similar to L<uniprop|/routine/uniprop>
890+
876891
877892
=head2 routine uniname
878893

0 commit comments

Comments
 (0)