Collections.List

(in ./Carbon/Collections/List.lua)

Provides utilities for operating on Lists and List-like data.

The List type Differs from the primtive list type by adding methods to it. It is possible to use these methods with a plain list, just call them in a non-object oriented way: List.Clear(list) List.ShallowCopy(list)

Inherits OOP.Object, Serializable


Methods

class public List:New([list data])

Returns List

  • optional data: The data of the list. Empty if not given.

Turns the given object into a List. Allows method-style syntax.


class public List.Clear(List self)

Returns void

object public List:Clear()

Returns void

  • required self: The list to source data from

Clears a list of all list values.


class public List.DeepCopy(list self, [list to, dictionary map, function copy_function, ...])

Returns List

  • required self: The list to source data from.
  • optional to: The list to copy into; an empty table if not given.
  • internal map: A map projecting original values into copied values. Used internally.
  • optional copy_function: The function to copy members with: defaults to this method.

Performs a self-reference fixing deep copy from one list into another. Handles self-references properly.


class public List.ShallowCopy(list self, [list to])

Returns list

  • required self: The list to source data from
  • optional to: The list to copy into; an empty table if not given.

Shallow copies data from one table into another and returns the result.


Properties

[none]