Re: The call "tag" in 5.0-work0
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: The call "tag" in 5.0-work0
- From: Tom Wrensch <twrensch@...>
- Date: 2002年7月10日 13:31:44 -0700 (PDT)
Sorry, just answered by own dumb question. You need to put underscores
before the name in 5.0 work 0.
- Tom
On 2002年7月10日, Tom Wrensch wrote:
> Hello,
>
> The call metatable entry ("tag") does not seem to work in Lua 5.0
> work-0. Has this been renamed or eliminated.
>
> For example, I can do this in 4.1w4:
>
> > mt = {}
> > mt.call = function(a, b, c, d) print(a,b,c,d) end
> > t = {}
> > metatable(t,mt)
> > t(1,2,3)
> table: 003032A0 1 2 3
> >
>
> But in 5.0 work-0 the same code produces an error:
>
> > mt = {}
> > mt.call = function(a,b,c,d) print(a,b,c,d) end
> > t = {}
> > metatable(t,mt)
> > t(1,2,3)
> stdin:1: attempt to call global `t' (a table value)
> stack traceback:
> 1- stdin:1: in main chunk
>
>
> - Tom
>
>