lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Sorry, that code isn't the actual code, just a demonstration code that I made really fast. It was to demonstrate that the __newindex wasn't working on a function definition function foo()end. But now I rewrote another one, and it seems to work. I guess I was wrong. Thanks anyway.

On Sat, Oct 31, 2009 at 7:17 PM, Luiz Henrique de Figueiredo <> wrote:
> However, this code doesn't seem to work:

> do
>   local cdoc
>   local docs
>   local function newindex(G,k,v)
>     docs[k]=cdoc

You need to initialize docs:
   local docs={}