From: dblack@... Date: 2006-07-09T07:31:44+09:00 Subject: Re: Alternative to the Symbol#to_proc hack Hi -- On Sun, 9 Jul 2006, Ashley Moran wrote: > > On Jul 08, 2006, at 9:05 pm, dblack@wobblini.net wrote: > >> Of course, I'm hopelessly non-edge -- I actually think that: >> >> %w{i am an array}.map {|item| item.upcase } >> >> is logical, reads nicely left to right, and contains no line noise :-) > > True, but that only makes Java look old-fashioned. I wanted to make Ruby > look old-fashioned ;o) Hmmmm... I'm still rather fond of Ruby, I have to admit :-) > Ever since I read about Higher-Order Messages at > http://nat.truemesh.com/archives/000537.html I've been determined to find a > way to write plain English as valid Ruby code. My goal is to find a neat way > to express business rules in Ruby, with as little framework coding as > possible. I think it may take a *little* more than extending the String > class though! Beware the dot, though. It can give you English, but at the expense of Ruby style. When I see: x = half.of.the.first.item.in(container) I want to know, and understand, what the message "the" means to the return value of a call to "of" -- and it isn't easy. Of course it's all legal Ruby, and can be documented... but it really sails beyond the horizon of what i would consider reasonable use of method-call syntax. In fact it's often a case of method-call syntax being used for method-*name* semantics. David -- "To fully realize the potential of Rails, it's crucial that you take the time to fully understand Ruby--and with "Ruby for Rails" David has provided just what you need to help you achieve that goal." -- DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS. Complete foreword & sample chapters at http://www.manning.com/black!