[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.13 User-defined Operators in GPC

GNU Pascal allows the user to define operators according to the Pascal-SC syntax:

 
program PXSCOperatorDemo;

type Point = record x, y: Real; end;

operator + (a, b: Point) c: Point; begin c.x := a.x + b.x; c.y := a.y + b.y; end;

var a, b, c: Point = (42, 0.5);

begin c := a + b end.

The Pascal-SC operators `+>', `+<', etc. for exact numerical calculations are not implemented, but you can define them.



This document was generated by Frank Heckenbach on May, 10 2002 using texi2html