![]() |
| ||||||||
Navigation |
Synopsis Splice the elements of a set in an enclosing set.
Syntax
*Exp
Types
Description The operator
* splices the elements of a set in an enclosing set.
Examples Consider the following set in which the set
{10, 20, 30] occurs as set element. It has as type set[value] :
rascal>{1, 2, {10, 20, 30}, 3, 4};
set[value]: {1,2,3,4,{10,20,30}}
The effect of splicing the same set element in the enclosing set gives a flat list of type set[int] :
rascal>{1, 2, *{10, 20, 30}, 3, 4};
set[int]: {1,2,3,4,10,20,30}
The same example can be written as:
rascal>S = {10, 20, 30}; set[int]: {10,20,30} rascal>{1, 2, *S, 3, 4}; set[int]: {1,2,3,4,10,20,30}
Benefits The splicing operator gives full, explicit, control over the way
in which nested sets are handled.
![]() |