Browse files

spec fc, remove capitalize (see titlecase)

capitalize was defined in terms of ucfirst, which no longer exists.
We also need to support case folding as defined by Unicode.
  • Loading branch information...
TimToady committed Mar 8, 2012
1 parent 3fbe6f7 commit efdbdd8165dc9249b7c013a8675a6ec68218d41a
Showing with 12 additions and 10 deletions.
  1. +12 −10 S32-setting-library/Str.pod
@@ -19,8 +19,8 @@ DRAFT: Synopsis 32: Setting Library - Str
Created: 19 Mar 2009 extracted from S29-functions.pod
Last Modified: 7 Nov 2011
Version: 5
Last Modified: 2012-03-08
Version: 6
The document is a draft.
@@ -93,6 +93,14 @@ Returns the input string after forcing each character to its uppercase
(not titlecase) form. Note that one-to-one mapping is not in general guaranteed;
different forms may be chosen according to context.
=item fc
multi method fc ( Str $string: --> Str ) is export
Does a Unicode "fold case" operation suitable for doing caseless
string comparisons. (In general, the returned string is unlikely to
be useful for any purpose other than comparison.)
=item titlecase
multi method titlecase ( Str $string: :&filter = &lc, :%exceptions = set() --> Str ) is export
@@ -105,6 +113,8 @@ if the word is found in the set of exceptions, the first character is also
forced through the filter. Note that the exceptions must be spelled with
an initial titlecase, such as "By" or "And", to produce "by" or "and".
Note, there is no longer any C<ucfirst> function because its semantics are not useful under Unicode.
=item normalize
multi method normalize ( Str $string: Bool :$canonical = Bool::True, Bool :$recompose = Bool::False --> Str ) is export
@@ -175,14 +185,6 @@ Has the effect of making the case of the string match the case pattern in C<$pat
Has the effect of making the case of the string match the marking pattern in C<$pattern>.
(Used by s:mm/// internally, see L<S05>.)
=item capitalize
multi method capitalize ( Str $string: --> Str ) is export
Has the effect of first doing an C<lc> on the entire string, then performing a
C<s:g/(\w+)/{ucfirst $0}/> on it.
=item length
This word is banned in Perl 6. You must specify units.

0 comments on commit efdbdd8

Please sign in to comment.