From: Alan Eden Date: 2007-12-31T08:22:27+09:00 Subject: Re: super simple language enhancement Very clever. However, I already have a "pre-processor" that removes the vertical lines before compilation. There doesn't seem to be much enthusiasm for my idea. All's I can say is that formatting code this way increases my comprehension 1000%. Otherwise I spend too much time and mental energy trying to "see" the structure of the code. But I guess everybody is surprised when other people see things differently from themselves. Oh well! Trans wrote: > On Dec 30, 11:07 am, Alan Eden wrote: >> | 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 > > I'm not in any way, shape or form, recommending it, but if you are so > inclined, you can do this: > > 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 > > T. -- Posted via http://www.ruby-forum.com/.