Set difference (-)


When the - operator has operands of set type then it performs set difference (i.e. the result of the operation is a set made up of the members in the left operand that are not in the right operand).


   ['a', 'b', 'c', 'd'] - ['a', 'j'] results in ['b', 'b', 'c', 'd']

To see this try the example program below:

   program setd(output);
      letter = 'a'..'z';
      s : set of letter;
      c : letter;
      s := ['a', 'b', 'c', 'd'] - ['a', 'j'];
      for c := 'a' to 'z' do
         if c in s then