[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Calling overloaded original functions
- From: Till Harbaum / Lists <lists@...>
- Date: Thu, 8 May 2008 21:43:49 +0100
So simple ...
Thanks, i obviously was just blind.
Till
Am Donnerstag 08 Mai 2008 schrieb Roberto Ierusalimschy:
> > i am trying to extend the tostring function to do something special
> > for my own special use tables. I found some example using the syntax
> > below:
> >
> > function tostring(a)
> > -- do something for special tables ...
> > -- otherwise call original function:
> > return %tostring(a)
> > end
> >
> > But this gives me an error for the % character. Omiting the % results in an
> > endless loop for obvious reasons ...
> >
> > How is this done?
>
> local oldtostring = tostring
> function tostring(a)
> -- do something for special tables ...
> -- otherwise call original function:
> return oldtostring(a)
> end
>
>
> -- Roberto
>