From: Austin Ziegler Date: 2006-07-05T06:35:05+09:00 Subject: Re: About 1.9 #__method__ feature. On 7/4/06, ara.t.howard@noaa.gov wrote: > > |Will #funcall be the way that I can circumvent private? > > obj.foo(5) # Throws an error, just as now. > > obj.send(:foo, 5) # Throws an error, it's private. > > obj.funcall(:foo, 5) # Success. funcall can call private. > what improvement does that give over > > obj.instance_eval{ send :foo, 5 } > > i mean, what's the purpose of a public method which can call private methods? Would obj.instance_eval { send(:foo, 5) } allow the call of private methods? However, the purpose is that #send (and #__send__) allow the call of private methods already. The change in 1.9 is that #send doesn't allow, but people depend on that, and it seems to me that #instance_eval (or #instance_exec -- which does what, exactly?) would be heavier weight than an explicit method. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca