2,875
edits
No edit summary |
No edit summary |
||
Line 103: | Line 103: | ||
-- Returns the first element of a sequence. | -- Returns the first element of a sequence. | ||
function funlist | function funlist:first() | ||
for _, v in pairs(mytable) do | for _, v in pairs(mytable) do | ||
return v | return v | ||
Line 119: | Line 119: | ||
-- Returns the last element of a sequence. | -- Returns the last element of a sequence. | ||
function funlist | function funlist:last() | ||
if funlist.any() == false then | if funlist.any() == false then | ||
error('Sequence contains no items.') | error('Sequence contains no items.') |
edits