lua-users home
lua-l archive

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


>   In general, you cannot [1]. In particular, there is no way to detect if
> Lua is executing within a loop.  The following Lua code:
> 
> [...]

Not to mention optimizations, gotos, and other strange constructions:

- if x then return end
  FOO()

Syntactically, the call is not inside an 'if', but semantically it is.

- repeat FOO() until true

Syntactically, the call is inside a loop, but semantically it isn't.
(See the opcodes!)

-- Roberto