List - SardonyxLang/SardonyxStd GitHub Wiki

require "list"

Common list manipulation functions.

Object List

  • List:map(f, x): applies the function f to every item in x, returning a new list.
  • List:filter(f, x): returns, in order, all items in x for which f returns truthy.
  • List:reduce(f, i, x): repeatedly applies f to reduce x to a single value, using i as an initial value.
  • List:range(b, e): returns a list containing a (non-lazy) range from b to e, non-inclusive. Will hang if b >= e.