List - SardonyxLang/SardonyxStd GitHub Wiki
require "list"
Common list manipulation functions.
Object List
List:map(f, x)
: applies the functionf
to every item inx
, returning a new list.List:filter(f, x)
: returns, in order, all items inx
for whichf
returns truthy.List:reduce(f, i, x)
: repeatedly appliesf
to reducex
to a single value, usingi
as an initial value.List:range(b, e)
: returns a list containing a (non-lazy) range fromb
toe
, non-inclusive. Will hang ifb >= e
.