list


list(@rest obj1, ...)
      

Return a new list with obj1, ... as elements.

A new list can also be constructed using the literal syntax: [obj1, ...]

Examples:


list()
// []
list(1, 2, 3) == [1, 2, 3]
// true

let xs = [10, 20, 30]
xs[1]
// 20
xs[1] = "hi"
xs
// [10, hi, 30]

// list comprehensions:
[x * y | x <- range(1, 2), y <- range(10, 12)]
// [10, 11, 12, 20, 22, 24]
      

Also see:

at
list_set
append
reverse


Core Module Index | Contents