From: "ara.t.howard" Date: 2007-12-31T12:23:27+09:00 Subject: Re: super simple language enhancement On Dec 30, 2007, at 9:07 AM, Alan Eden wrote: > def say_hi > | if @names.nil? > | | puts "..." > | elsif @names.respond_to?("each") > | | # @names is a list of some kind, iterate! > | | @names.each do |name| > | | | puts "Hello #{name}!" > | | end > | else > | | puts "Hello #{@names}!" > | end > end > > Or is there a > good reason why this isn't done that I'm missing? def say_hi puts( @names ? [*@names].map{|nm| "Hello #{ nm }!"} : "..." ) end that, and vim can do this for you already. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama