Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
No such thing as a small change
 
PerlMonks  

Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)

by Arunbear (Parson)
on Dec 12, 2006 at 14:28 UTC ( #589282=note: print w/ replies, xml ) Need Help??


in reply to Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)

Here is a Lisp version (not much improvement on Perl/Ruby):

newLISP v.9.0 on Win32 MinGW. > (define (reverseWords s) (join (reverse (parse s)) " ")) (lambda (s) (join (reverse (parse s)) " ")) > (reverseWords " one two three four ") "four three two one"
Do you ever wonder if the future is Haskell (e.g. you can write Perl6 in it)?


Comment on Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
Download Code
Re^2: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by bennymack (Pilgrim) on Dec 12, 2006 at 15:07 UTC
    When at the barrel of a gun...

      or when busy writing an haskell compiler in perl6...;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589282]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-04-23 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (557 votes), past polls