![]() |
|
Navigation |
Synopsis Remove an arbitrary element from a set, returns the element and a set without that element.
Function
tuple[&T, set[&T]] takeOneFrom(set[&T] st) throws EmptySet
Usage
import Set;
Description Remove an arbitrary element from set
s and return a tuple consisting of the element and a set without that element.
Also see getOneFrom.
Examples
rascal>import Set; ok rascal>takeOneFrom({1, 2, 3, 4}); tuple[int,set[int]]: <3,{1,2,4}> rascal>takeOneFrom({1, 2, 3, 4}); tuple[int,set[int]]: <4,{1,2,3}> rascal>takeOneFrom({1, 2, 3, 4}); tuple[int,set[int]]: <2,{1,3,4}> ![]() |