Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

symmetric difference

><

The symmetric difference operator is applicable to set variables. By mathematical definition, A >< B is $\left( A \setminus B \right) \cup \left( B \setminus A \right)$.

pascal
procedure test_differ;
var
  a: set of char = ['a', 'b', 'c'];
  b: set of char = ['b', 'c', 'x', 'y'];
  c: set of char;
begin
  c:= a >< b; // c becomes ['a', 'x', 'y']
end;

The symmetric difference operator is defined by Extended Pascal, ISO standard 10206. In the FPC it is available in any mode, not just {$mode extendedPascal}.


From the Free Pascal wiki, page "symmetric difference", as it stood on 2022-01-27 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .