FANDOM


Lexical ConventionsEdit

EssentialsEdit

Lexical conventions are the names or identifiers of variables. Here are some facts you must know about them.

  • They can only be comprised of alphanumerics (0-9, a-z, A-Z), with the exception of the _.
  • They cannot be Lua keywords.
  • They are case sensitive.
  • They mustn't start with a digit.

SamplesEdit

Sample
The following are correct identifiers.

Source:

local foo = 'bar'
local foo2 = 'bar'
local And = 'bar'
local ____ = 'bar' 
Output:



Sample
The following are incorrect identifiers.

Source:

local 2foo = 'bar'
local &foo = 'bar'
local and = 'bar'
Output:



ExtraEdit

Camel CaseEdit

Camel casing is a popular convention when it comes to variable identifiers.

Sample
The following is an example of variable identifiers that are camel cased.

Source:

local fooBar = 'foo'
local barFooBaz = 'baz'
Output:


Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.