Syntactic Confectionery Delight | |
PerlMonks |
Smalltalk - Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)by carcassonne (Pilgrim) |
on Dec 15, 2006 at 02:31 UTC ( [id://589971]=note: print w/replies, xml ) | Need Help?? |
Here goes in Smalltalk:
#('one' 'two' 'three' 'four') reversed Do a print-It in the workspace and it gives: #('four' 'three' 'two' 'one') You put your things in an OrderedCollection and this collection has a reversed message that can be sent to it. Voilą !
In Section
Meditations
|
|