Set intersection (*)


When the * operator has operands of set type then it performs set intersection (i.e. the result of the operation is a set made up of the members common to both the left and right operands).


   ['a', 'b', 'c', 'd'] * ['a', 'c', 'j', 'z']  results in ['a', 'c']

To see this try the example program below:

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