Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
Replies are listed 'Best First'.
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 avoiding work at the Monastery: (18)
As of 2015-07-28 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (255 votes), past polls