lua-users home
lua-l archive

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


On Tue, 12 Jan 2010, Doug Rogers wrote:
>
> Are you thinking of the hook as a function that takes the environment as
> its argument, or would it run 'in' the environment like the code in the
> block?

The hook is defined outside the scope of the in/do block so it has
whatever environment is in force at its point of definition.

As I originally specified it the hook takes no arguments, but your idea of
passing the environment as an argument would often remove the need to
create a new closure.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.