Skip to content
Anssi Halmeaho edited this page May 9, 2020 · 2 revisions

stdset

Provides primitives to use set -datastructure. Set datastructure is actually implemented as map.

newset

Creates new empty set.

type : function

Format:

call(stdset.newset) -> <set>

is-empty

Returns whether set is empty (true if empty, false otherwise).

type : function

Format:

call(stdset.is-empty <set>) -> <bool>

setlen

Returns number of items in set (int).

type : function

Format:

call(stdset.setlen <set>) -> <int>

as-list

Returns set items in list.

type : function

Format:

call(stdset.as-list <set>) -> <list>

has-item

Returns true if item is in set, false otherwise.

type : function

Format:

call(stdset.has-item <set>) -> <bool>

remove-from-set

Removes item from set (if it is in it).

type : function

Format:

call(stdset.remove-from-set <set> <item-value>) -> <set>

add-to-set

Adds one item to set.

type : function

Format:

call(stdset.add-to-set <set> <item-value>) -> <set>

list-to-set

Adds items in list (2nd argument) to set.

type : function

Format:

call(stdset.list-to-set <set> <items-list>) -> <set>

union

Creates union of two sets given as arguments.

type : function

Format:

call(stdset.union <set> <set>) -> <set>

intersection

Creates intersection set of two sets given as arguments.

type : function

Format:

call(stdset.intersection <set> <set>) -> <set>

difference

Returns set with elements in first set (1st argument) but not in second set (2nd arguement).

type : function

Format:

call(stdset.difference <set> <set>) -> <set>

is-subset

Return true if second set (2nd argument) is subset of first set (1st argument), false otherwise.

type : function

Format:

call(stdset.is-subset <set> <set>) -> <bool>

equal

Returns true if two sets given as arguments are having same items, false otherwise.

type : function

Format:

call(stdset.equal <set> <set>) -> <bool>
Clone this wiki locally