Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
move Str.reverse to setting/
I have no idea why reverse($str) still works, but it does.
  • Loading branch information
moritz committed Feb 20, 2009
1 parent 344b93a commit f7c0c0b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
1 change: 1 addition & 0 deletions build/Makefile.in
Expand Up @@ -110,6 +110,7 @@ SETTING = \
src/setting/Bool.pm \
src/setting/List.pm \
src/setting/Pair.pm \
src/setting/Str.pm \
src/setting/Whatever.pm \

PMCS = perl6str objectref perl6scalar mutablevar perl6multisub
Expand Down
16 changes: 1 addition & 15 deletions src/classes/Str.pir
@@ -1,5 +1,3 @@
## $Id$

=head1 TITLE

Str - Perl 6 Str class and related functions
Expand Down Expand Up @@ -28,7 +26,7 @@ as the Perl 6 C<Str> class.
p6meta.'register'('String', 'parent'=>strproto, 'protoobject'=>strproto)

$P0 = get_hll_namespace ['Str']
'!EXPORT'('sprintf,reverse', 'from'=>$P0)
'!EXPORT'('sprintf', 'from'=>$P0)
.end


Expand All @@ -49,18 +47,6 @@ as the Perl 6 C<Str> class.
.end


.sub 'reverse' :method :multi('String')
.local pmc retv

retv = self.'split'('')
retv = retv.'reverse'()
retv = retv.'join'('')

.return(retv)
.end



=item perl()

Returns a Perl representation of the Str.
Expand Down
11 changes: 11 additions & 0 deletions src/setting/Str.pm
@@ -0,0 +1,11 @@
class Str is also {
our Bool multi method ACCEPTS ($topic) {
self eq $topic;

}
our Str multi method reverse ($str: ) {
return $str.split('').reverse.join;
}
}

# vim: ft=perl6

0 comments on commit f7c0c0b

Please sign in to comment.