Re: luajit and goto

  • From: David Given <david.given@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 18 Dec 2013 12:24:28 +0000

On 18/12/13 00:40, Peter Cawley wrote:
[...]
> The following three excepts from the 5.2 reference manual would seem
> to make the particular example valid:
> 
> 1. A goto may jump to any visible label as long as it does not enter
> into the scope of a local variable.
> 2. The scope of a local variable begins at the first statement after
> its declaration and lasts until the last non-void statement of the
> innermost block that includes the declaration.
> 3. Labels and empty statements are called void statements, as they
> perform no actions.

Ouch. Yes, that does make a certain extremely non-intuitive sense. Which
implies that when LuaJIT is in non-5.2-compatibility-mode is has
stricter specced goto than Lua 5.2 (which is a good thing).

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "There does not now, nor will there ever, exist a programming
│ language in which it is the least bit hard to write bad programs." ---
│ Flon's Axiom

Attachment: signature.asc
Description: OpenPGP digital signature

Other related posts: