lua-users home
lua-l archive

Re: Accessing in a child class the attribute of a parent class

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


	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

AltStyle によって変換されたページ (->オリジナル) /