Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deprecate .ucfirst and .lcfirst, per the current synopses (RT #114012).
  • Loading branch information
pmichaud committed Jul 6, 2012
1 parent 501e8a2 commit 5ee1f1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog
Expand Up @@ -6,6 +6,7 @@ New in 2012.07
+ Exception.fail
+ Changed &dir to return IO::File and IO::Dir objects, not strings
+ anonymous subset types with subset :: where ...;
+ Deprecated .bytes, .ucfirst, and .lcfirst

New in 2012.06
+ Rakudo is now compiled with the same regex engine as user-space regexes use
Expand Down
10 changes: 6 additions & 4 deletions src/core/Cool.pm
Expand Up @@ -82,12 +82,12 @@ my class Cool {
nqp::p6box_s(nqp::lc(nqp::unbox_s(self.Str)))
}

method ucfirst() {
method ucfirst() is DEPRECATED {
my $self-str = self.Str;
$self-str eq '' ?? '' !! $self-str.substr(0, 1).uc ~ $self-str.substr(1)
}

method lcfirst() {
method lcfirst() is DEPRECATED {
my $self-str = self.Str;
$self-str eq '' ?? '' !! $self-str.substr(0, 1).lc ~ $self-str.substr(1)
}
Expand Down Expand Up @@ -199,11 +199,13 @@ sub chomp(Cool $s) { $s.chomp }
sub flip(Cool $s) { $s.flip }
sub index(Cool $s,$needle,$pos=0) { $s.index($needle,$pos) }
sub lc(Cool $s) { $s.lc }
sub lcfirst(Cool $s) { $s.lcfirst }
sub ord(Cool $s) { $s.ord }
sub substr(Cool $s,$pos,$chars?) { $s.substr($pos,$chars) }
sub uc(Cool $s) { $s.uc }
sub ucfirst(Cool $s) { $s.ucfirst }

sub lcfirst(Cool $s) is DEPRECATED { $s.lcfirst }
sub ucfirst(Cool $s) is DEPRECATED { $s.ucfirst }

proto sub rindex(|$) { * };
multi sub rindex(Cool $s, Cool $needle, Cool $pos) { $s.rindex($needle, $pos) };
multi sub rindex(Cool $s, Cool $needle) { $s.rindex($needle) };
Expand Down

0 comments on commit 5ee1f1e

Please sign in to comment.