Previous Up Next

6.41.5  Difference of two sets or of two lists: minus

The minus operator is an infixed operator that can find the set difference of the elements of two sets or lists; the result will always be a set.


Examples.

Cartesian products

Defining an n-tuple: tuple

To define an n-tuple (rather than a list of n objects), you can put the elements, separated by commas, inside the delimiters tuple[ and ].


Example.
Input:

set[tuple[1,3,4],tuple[1,3,5],tuple[2,3,4]]

Output:

⟦ tuple
1,3,4
,tuple
1,3,5
,tuple
2,3,4

The Cartesian product of two sets: *

You can compute the Cartesian product of two sets with the infixed * operator.


Examples.


Previous Up Next