Loading

()

sets

The () function creates an empty SET on the top of the stack. A Set is a collection that cannot contain duplicate elements.

This is an implementation of java HashSet. NULL object is permitted. It makes no guarantees as to the iteration order of the set.

The SET object could not be represented on the stack. It has to be converted in a list to be displayed.

Storing GTS into sets do not guarantee uniqueness. each GTS has a hidden id. see example.

() is available since version 1.2.13.

See also

Signatures

Examples

( 'alpha' 'beta' ) 'gamma' +! 'alpha' +! 'aa' +! 'aa' +! //set guarantee items uniqueness 42.5 +! //other types... true +! SET-> //turn into a list to see the instance on the stack.
( 'a' 'b' 'c' 'd' 'e' 'f' 'aa' 'ff' ) 'myset' STORE $myset <% // no guarantees as to the iteration order of the set... %> FOREACH
NEWGTS 'test' RENAME 10 48.630 -4.57 0 '(48.630, -4.57)' ADDVALUE 'gts1' STORE NEWGTS 'test' RENAME 10 48.630 -4.57 0 '(48.630, -4.57)' ADDVALUE 'gts2' STORE //gts1 and gts2 are exactly the same ( ) $gts1 +! $gts2 +! SET->