lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thank you!

Pete Gardner
President, CEO
Helikon Technologies Inc.
http://www.helikon.com




> -----Original Message-----
> From: Steve Dekorte [mailto:steve@yindo.com]
> Sent: Wednesday, November 15, 2000 3:17 PM
> To: Multiple recipients of list
> Subject: Re: Data inheritance problem
> 
> 
> 
> Pete Gardner wrote:
> >counter:child_inc()	-- but this works on counter_base's 
> data, not counter's...
> > Am I overlooking something?  Is this expected behaviour?  
> How can I make 
> > child_inc() work on it's own data? 
> 
> If you want it to work on the child you need to change:
>     function counter:child_inc() self.parent:inc() end
> to:
>     function counter:child_inc() self.parent.inc(self) end
> or more simply:
>     function counter:child_inc() self:inc() end
> 
> If you implement a method lookup tag on your objects.
> 
> Steve
>