Set union (+)


When the + operator has operands of set type then it performs set union (i.e. the result of the operation is a set with all the members from both operands).


   ['a', 'e'] + ['a', 'c', 'z'] results in ['a', 'c', 'e', 'z']

To see this try the example program below:

   program setu(output);
      letter = 'a'..'z';
      s : set of letter;
      c : letter;
      s := ['a', 'e'] + ['a', 'c', 'z'];
      for c := 'a' to 'z' do
         if c in s then