How to get a specific element from the set - PlusCal

338 views Asked by At

Given the set, for example, {1, 2, 4, 10, 6} how can I get the element 4 to a variable var. What I want is to get element "4" from the set to a variable var: var = 4 And remove the element 4 from the set: set = {1, 2, 10, 6}

1

There are 1 answers

0
Hovercouch On BEST ANSWER

Based on the comments, it sounds like you want this:

with x \in set do
   var := x;
   set := set \ {x};
end with;