Skip to content

Commit

Permalink
implement tclc
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jul 24, 2012
1 parent a4eacdf commit 4fe23e7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/ChangeLog
@@ -1,3 +1,6 @@
New in 2012.08
+ tclc implemented

New in 2012.07
+ Deprecated SAFE.setting in favor of RESTRICTED.setting
+ Ranges can now interpolate in argument lists
Expand Down
7 changes: 7 additions & 0 deletions src/core/Cool.pm
Expand Up @@ -82,6 +82,10 @@ my class Cool {
nqp::p6box_s(nqp::lc(nqp::unbox_s(self.Str)))
}

method tclc() {
self.Str.tclc;
}

method ucfirst() is DEPRECATED {
my $self-str = self.Str;
$self-str eq '' ?? '' !! $self-str.substr(0, 1).uc ~ $self-str.substr(1)
Expand Down Expand Up @@ -220,6 +224,9 @@ proto sub capitalize(|$) { * }
multi sub capitalize(Str:D $x) {$x.capitalize }
multi sub capitalize(Cool $x) {$x.Stringy.capitalize }

proto sub tclc(|$) { * }
multi sub tclc(Cool $x) { tclc $x.Str }

sub sprintf(Cool $format, *@args) {
@args.gimme(*);
nqp::p6box_s(
Expand Down
8 changes: 8 additions & 0 deletions src/core/Str.pm
Expand Up @@ -908,6 +908,10 @@ my class Str does Stringy {
$_<indent-chars.key.join ~ ' ' x ($pos - $outdent) ~ $_<rest>;
}).join;
}

method tclc(Str:D:) {
nqp::p6box_s(nqp::tclc(nqp::unbox_s(self)))
}
}


Expand Down Expand Up @@ -1011,3 +1015,7 @@ sub substr-rw($s is rw, $from = 0, $chars = $s.chars - $from) {
}
);
}

multi sub tclc(Str:D $s) {
nqp::p6box_s(nqp::tclc(nqp::unbox_s($s)));
}
1 change: 1 addition & 0 deletions t/spectest.data
Expand Up @@ -638,6 +638,7 @@ S32-str/split.t
S32-str/sprintf.t
S32-str/substr.t
S32-str/substr-rw.t
S32-str/tclc.t # icu
S32-str/trim.t
S32-str/uc.t # icu
S32-str/unpack.t
Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2012.07
2012.07-14-gcff22c2

0 comments on commit 4fe23e7

Please sign in to comment.