Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Deprecate .ucfirst and .lcfirst, per the current synopses (RT #114012).

  • Loading branch information...
commit 5ee1f1e6dc5deaacc79de8b75c1e2d3af45676f1 1 parent 501e8a2
@pmichaud pmichaud authored
Showing with 7 additions and 4 deletions.
  1. +1 −0  docs/ChangeLog
  2. +6 −4 src/core/Cool.pm
View
1  docs/ChangeLog
@@ -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
View
10 src/core/Cool.pm
@@ -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)
}
@@ -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) };
Please sign in to comment.
Something went wrong with that request. Please try again.