HaloO,
Jonathan Lang wrote:
Other cases: What would 'Set.push(items)' and 'Set.pop()' do? What
_is_ the appropriate way to go about adding items to (or removing
items from) a Set, or of searching the Set for an element?
Since Sets are immutable values there should be no push and pop
methods. These are part of the rw Array interface. Instead we
have:
my Set $s = set(1,2,3);
$s (|)= (4,5,6); # $s === set(1,2,3,4,5,6)
$s (-)= (5,6); # $s === set(1,2,3,4)
Searching a set is just the element containment test:
if 3 (in) $s { say "set contains 3" }
Regards, TSa.
--