Created
August 7, 2009 02:28
-
-
Save treed/163680 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sub 'reverse' :method | |
.local pmc res | |
.local int i | |
res = new 'CardinalString' | |
.local pmc iterator, item | |
iterator = iter self | |
each_loop: | |
unless iterator goto each_loop_done | |
item = shift iterator | |
res = concat item, res | |
goto each_loop | |
each_loop_done: | |
.return(res) | |
.end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment