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

Provides operations for operating on unordered sets.

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


class public Set:New([table data])

Returns Set

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

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

class public Set.ToList(table self, [table out])

Returns List

object public Set:ToList([table out])

Returns List

  • required self: The set to collect members for.
  • optional out: Where to put the resulting data. Put into a new List by default.

Collects all members of the set and puts them in a list.