lua-users home
lua-l archive

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


On 08/09/12 23:48, marbux wrote:
[...]
> I'm playing with v. 5.2's goto function but have not come up with a
> compact method to test for the existence of a particular label in the
> script without terminating the script if the label does not exist.

I don't believe you can --- my understanding is that labels are pure
compile-time constructs and don't contain any runtime state. A jump to
an undefined label should produce a compile-time error, not a run-time
error.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ life←{ ↑1 ⍵∨.^3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ }
│ --- Conway's Game Of Life, in one line of APL

Attachment: signature.asc
Description: OpenPGP digital signature