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 goto statement 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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -