[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Wrapping "Classes" seamlessly
- From: jdarling@...
- Date: Mon, 15 May 2006 12:58:02 -0700
never herd of compat... Does it exist in 5.0, and if so where do I find
it :)?
- Jeremy
"Help I suffer from the oxymoron Corporate Security."
> -------- Original Message --------
> Subject: Re: Wrapping "Classes" seamlessly
> From: Stefan Sandberg <keffo.sandberg@gmail.com>
> Date: Mon, May 15, 2006 2:55 pm
> To: Lua list <lua@bazar2.conectiva.com.br>
>
> It's painfully simple to see what's being done if you poke around a bit
> in compat-5.1.lua.
>
> Keffo.
>
> jdarling@eonclash.com wrote:
> > I've worked up quite a few object wrappers for my applications, and have
> > run into a common problem with all. If I want to create a new
> > descendent from the object I get errors back when trying to call the
> > methods.
> >
> > My solution to this is to create a new "Class" in Lua and embed the
> > wrapped class into it. This works fine, except that I have to create
> > wrapper methods for each method and property that exists in my new
> > version. Can anyone give me some quick pointers to how to setup my
> > MetaTable to manage this for me? I'd like something like a fall
> > through where if the method/property doesn't exist or isn't found in
> > the new version it falls back to the wrapped type.
> >
> > Also does anyone know how hard it is to overload/override the default
> > require's handler? I'd like to be able to redirect require and
> > dofile when editing the scripts so that if a modified version exists
> > in memory it is used over the one on disk.
> >
> > - Jeremy
> >
> > "Help I suffer from the oxymoron Corporate Security."
> >
> >
> >
> >