lua-users home
lua-l archive

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


On Friday 16 September 2005 4:20 am, Rici Lake wrote:
> This allows you to create a wrapper which is quite flexible:
>
> function(env)
>   in env do
>     return function()
>       -- insert code here
>     end
>   end
> end
>
> Now every time this factory is executed, it creates a new instance of the
> embedded code with a different environment.

i don't get how's this different from:

function (env)
  return (setfenv (function()
    -- insert code here
  end, env))
end

-- 
Javier

Attachment: pgph8ZjarOHoC.pgp
Description: PGP signature