[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Penlight - Calling the constructor of a parent class
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 3 Jan 2013 09:50:39 +0200
On Thu, Jan 3, 2013 at 6:26 AM, Luciano de Souza <luchyanus@gmail.com> wrote:
> function window:_init(title)
> control:_init(title)
> end
That would _almost_ work; it's true that super is the shortcut, but in
general to call any method of a base class you should say:
control._init(self,title)
That is, look up the method in the base class and call it explicitly.
Nice if there was a way of creating sugar for this, but I haven't
found one yet.
steve d.