From: Eric Mahurin Date: 2005-05-27T08:43:06+09:00 Subject: Re: will callable objects be more general in Ruby 1.9? --- Yukihiro Matsumoto wrote: > Hi, > > In message "Re: will callable objects be more general in Ruby > 1.9?" > on Fri, 27 May 2005 02:34:21 +0900, Eric Mahurin > writes: > > |In Ruby 1.9 CVS, you can "call" local variables. i.e. > | > |f = {|*args,&block| puts(*args);block[]} > | > |f("hello","world!") {puts("bye")} > | > |The last statement is equivalent to: > | > |f.call("hello","world!") {puts("bye")} > > |Any plans making these callable objects more general? > > In fact, I am thinking reverting this "call" change. It > causes code > incompatibility, and lacks some generality, as you've stated. > > matz. I was kind of looking forward to the further unification of objects - all objects being callable like methods already are. In terms of compatibility, I assume you are referring to the fact that if you have a local variable f (callable or not), f() will try to call it even if the method f exists (in 1.9). I like this new behavior (local variables always override), but to preserve compatibility couldn't you just change the priority? - f() would prefer calling method f over calling local variable f. Eric __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/