Re: Accessing in a child class the attribute of a parent class
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Accessing in a child class the attribute of a parent class
- From: Tomas Guisasola Gorham <tomas@...>
- Date: Wed, 5 Jan 2011 23:15:10 -0200 (BRST)
Hi Luciano
class.child(shared(parent))
function child:__init()
parent:__init()
self.b = 22
end
Seems strange that you have to write both that child inherits
from (shared) parent and also calls the __init method from parent...
Will the call to parent:__init() be sufficient?
Regards,
Tomás