lua-users home
lua-l archive

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

On Fri, 7 Sep 2001 wrote:

> If the former, how is the following handled:
> for k, v in tab do
>   actors[k] = function(x) act_on(v, x) end
> end

Simply like this:

  for k, v in tab do
    local v = v
    actors[k] = function (x) act_on(v, x) end

> I'd be quite content if I can get the existing behaviour by specifying
> act_on(%v, x)

I guess it is too much trouble for something that is easily done by
other means.

-- Roberto