uses System.Math;
type
TPoint = record
X, Y: Integer;
constructor Create(AX, AY: Integer);
//new operators cannot be invented:
//an existing one gets a new meaning
class operator BitwiseXor(const P: TPoint;
Power: Integer): TPoint;
end;
constructor TPoint.Create(AX, AY: Integer);
begin
X := AX;
Y := AY;
end;
class operator TPoint.BitwiseXor(
const P: TPoint; Power: Integer): TPoint;
begin
Result := TPoint.Create(
Round(System.Math.Power(P.X, Power)),
Round(System.Math.Power(P.Y, Power)));
end;
var
P1: TPoint;
begin
P1 := TPoint.Create(2, 3);
P1 := P1 xor 3;
//p1.X is 8 and p1.Y is 27
WriteLn('x = ', P1.X, ', y = ', P1.Y);
end.