special characters - What is the purpose of double colons in Lua? -
i have been aware version 5.3 lua had come out not long ago hadn't had reason visit documentation online until now. may wrong, not believe remember usage of double-colons :: used abundantly there.
i see considered "special token" others (greater than, less than, asterisks, etc) know for.
what purpose of using them in lua?
:: used 1 thing in lua *:
declaring labels jumping goto.
goto label ::label:: the
gotostatement transfers program control label. syntactical reasons, labels in lua considered statements too:stat ::= goto name stat ::= label label ::= ‘::’ name ‘::’a label visible in entire block defined, except inside nested blocks label same name defined , inside nested functions. goto may jump visible label long not enter scope of local variable.
labels , empty statements called void statements, perform no actions.
* don't consider extensive use extended bnf in documentation use in lua itself.
Comments
Post a Comment