Hi --

On Sun, 24 Jul 2005, Jay Levitt wrote:

> In article <1122130106.912486.45730 / g49g2000cwa.googlegroups.com>,
> transfire / gmail.com says...
>> I know there are plans to give Ruby private instance variables, but I'm
>> wondering if there are any plans to provide the corresponding type of
>> thing for methods, i.e. local instance methods. To clarify, a local
>> instance method is a method that does not participate in the
>> inheritance chain and is only callable from within the class it is
>> defined.
>
> How's that differ from a singleton method, which Ruby does have?

Say you had:

   class C
     def_local_instance_method x
     # ...
     end
   end

   class D < C
   end

   c = C.new
   c.x
   cc = C.new
   cc.x

   d = D.new
   d.x        # No such method

Note that both of my C instances respond to x (it's not a singleton
method on a particular object), but the D instance doesn't.


David

-- 
David A. Black
dblack / wobblini.net