Difference between revisions of "sequence"
m (Add example.) |
(Add example without explicit indices) |
||
Line 4: | Line 4: | ||
<source lang='lua'> | <source lang='lua'> | ||
+ | sequence = { 'foo', 'bar', 'baz', 'qux', --[[ ... ]] } | ||
+ | |||
+ | -- or | ||
+ | |||
sequence = { | sequence = { | ||
[1] = 'foo', | [1] = 'foo', |
Latest revision as of 16:28, 28 January 2015
From the Lua 5.2 reference manual §2.1:
We use the term sequence to denote a table where the set of all positive numeric keys is equal to {1..n} for some integer n, which is called the length of the sequence (see §3.4.6).
sequence = { 'foo', 'bar', 'baz', 'qux', --[[ ... ]] } -- or sequence = { [1] = 'foo', [2] = 'bar', [3] = 'baz', [4] = 'qux', -- [n] = ..., }
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info