[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: New user question re: settagmethod
- From: Tomas <tomas@...>
- Date: Tue, 14 Nov 2000 18:39:25 -0200 (BRST)
> function inherit (object, field)
> if field == "parent" then -- avoid loops
> return nil
> end
> local p = object.parent -- access parent object
I think you should use rawgettable instead:
rawgettable (object, "parent")
> if type(p) == "table" then -- check if parent is a table
> return p[field] -- (this may call Inherit again)
> else
> return nil
> end
> end
>
> -- Set the tag method.
> settagmethod(tag(BaseTable),"index",inherit)
Here you can use just an empty table, but I think it'll be the same:
settagmethod (tag({}), "index", inherit)
Tomas