lua-users home
lua-l archive

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


On Sun, Jan 12, 2014 at 2:34 AM, Andres Perera <andres.p@zoho.com> wrote:
> On Sat, Jan 11, 2014 at 2:33 PM, Kaj Eijlers <bizziboi@gmail.com> wrote:
>> Whoops, sorry about the top post - gmail conveniently hides it.
>>
>> Never seen it in assembly, maybe I got too late to the assembly game (around
>> 1982), all assemblers I have used had proper labels (or maybe they supported
>> it but noone I interacted with used them - thank God!)
>
> op is describing two things: syntax relative jumps and nameless
> labels, with little correlation between the two
>
> the former you have in gas[0], eg jmp 1f to jump to the nearest label
> named 1 doing a forward transversal
>
> 0: http://tigcc.ticalc.org/doc/gnuasm.html#SEC48

furthermore,

* lua alleviates namespace exhaustion by having block scoped labels;

* having unnamed labels has demonstrably no impact when paired with
syntax-rel jumps, making reusable names that the parser turns into
block-unique the real issue;

-- named
x = 0
::a::
x = x + 1
if (x == 4) goto + end
goto -
::b::

-- unnamend
x = 0
::@::
x = x + 1
if (x == 5) goto + end
goto -
::@::

>
>> Anyhow, I prefer labels to be named according to their function in the loop
>> because even I who has advocated goto usage in C for a long time in the
>> workplace find them pretty much unneeded nowadays and obscuring flow.
>>