lua-users home
lua-l archive

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


> - disallow a definition of a label if that label is already visible in
> the scope. The above example would be illegal, but the next one would be
> ok:
> 
> [...]

Beware that a label is visible before its declaration. So, there is
no sensible difference between these two examples:

  -- example 1
  ::label::   -- 1
  do
    goto label
    ::label::   -- 2
  end

  -- example 2
  do
    ::label::   -- 1
    goto label
  end
  ::label::   -- 2

So, your second option should also disallow example 2. The first
label is not visible when the second is declared, but the second
label is visible when the first one is declared!  (Nevertheless,
this seems a nice compromise between one-per-function and one-per-
block.)
  
-- Roberto