Skip to main content

Sets

A Set is a collection of elements that are unique (i.e. that does not contain duplicates). The only way to create a Set from other types is to use the ipAddressSet function.

The following operations are available on sets.

  • isEmpty(set): Returns a Bool indicating if set contains no elements.
  • A + B: Returns the union of sets A and B.
  • A - B: Returns the differences of the sets A and B, which contains the elements in A that are not in B.
  • intersect(set1, set2): Returns the intersection of set1 and set2.
  • ip in set: Returns a Bool indicating if the IpAddress ip is contained in set.
  • subnet in set: Returns a Bool indicating if the set of IpAddresses represented by the IpSubnet subnet is a subset of set.
  • subset in superset: Returns a Bool indicating if subset is a subset of superset.