You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matěj Štágl edited this page May 19, 2022
·
2 revisions
Enum proposal
Enum is a readonly specialisation of table with automatic incremental indexing of it's properties. Multiple keys can share the same value.
An empty enum is declared as:
enumE{}
To add pairs, assignment = syntax is used.
enumE{Red=0,Green=1,Yellow=2}
RHS of a pair can be ommited.
if it's a first pair, 0 is assigned implicitly
else value of a previous pair increased by one is assigned implicitly