From: Martin DeMello Date: 2003-01-13T05:50:01+09:00 Subject: Re: Ruby advocacy in sigs Chad Fowler wrote: > > Agreed. I'd say the most powerful Ruby advocacy .sig would be something > to the tune of: > > http://www.ruby-lang.org Little (72x4) code snippets that were sufficiently eye-catching would be a nice positive way to do it. Not along the lines of perl's JAPHs, more like code whose meaning is obvious when you read it, and which is cool in a "wow - Ruby lets you do it that simply/elegantly/enjoyably?!" sense. (The Haskell quicksort is a perfect example of the sort of thing I have in mind). Some off-the-top-of-my-head examples (and I'm sure there are several far better ones) def twice; yield; yield; end twice {print "Hello World"} nthreads.times {|i| Thread.new {task[i].call}.join} #Multithreading Ruby style. "hello world".gsub(/\w*/) {|match| match.reverse} # => "olleh dlrow" print "hello #{name}" if friends.include?(name) unless no_greet a, b = b, a # who needs temp variables martin