lua-users home
lua-l archive

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


>> The other thing that puzzles me, is that when I run a script file
>> like the one below, the linehook function doesn't kick in until
>> the second time I run it. What might be the reason for that?
>A Lua bug.

No, this is a feature ;-)
Line and call hooks do not become active until the current function returns.
In the example given, until the chunks ends.

If the hooks become active immediately (as they did in previous versions),
them things get confusing. For instance, you'd get a "return" call in the call
hook, without having got a corresponding "call".
--lhf