Top index Wirbel home

::set

set(list(T) alist) - converts a list into a set
set(set(T) aset) - converts a set to a set (no operation)
list(A).set(int, A) - change list element
set(string astring) - convert string to set of characters
dict(A.set(B), A, B) - make entry in dictionary
set(dict(A, B) adict) - convert dict to set of keys

set(list(T) alist) converts a list alist into a list. The returned set contains all items of alist but without duplicates. The order of the items in alist is not preserved since sets do not preserve order in general.

set(set(T) aset) returns aset and is useful for polymorphic programming, i.e. places where you do not know wether the datatype is list or set.

list(A).set(int, A) changes to list at a given index to a new value. This is the same as using the subscript operator in an assignment.

set(string astring) returns a set of all characters contained in astring

dict(A.set(B), A, B) makes a new entry in a dictionary or replaces an existing entry. This is the same as using an assignment to the subscript operator.

set(dict(A, B) adict) converts adict into a set of its keys. The values are not accounted for. This is usefull for polymorphic programming.

Examples

adict[17] = "Mathias"

See also

set