On Fri, Aug 25, 2006 at 09:18:39AM +0900, Matthew Johnson wrote: > > There are languages (Scheme is one if I remember correctly) where the > two are semantically equivalent and thus () is used as a call > operator for both types of definitions. All functions / methods are > anonymous unless bound to a name. In such a language this would > indeed be a redefinition of the method as def is simply syntactic > sugar. This is approach is clean and simple in many respects, but is > different than the approach Ruby takes. Unless Ruby were to change > its semantics (not likely) I think David is right that this approach > won't work in Ruby. . . . except that in Lisps the () is list syntax, and the reason closures and methods share that syntax is that everything is a list. That's my understanding, anyway. Then again, I'm no Lisp expert. On the other hand, Perl might be a good example of unified syntax for methods and closures. In both cases, calling the thing involves a dereferencing, for which ->() is the syntax. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "It's just incredible that a trillion-synapse computer could actually spend Saturday afternoon watching a football game." - Marvin Minsky