Go to the first, previous, next, last section, table of contents.

User-defined operators

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

  (*$X+*)

  Type
    Point = record
      x, y: Real;
    end (* Point *);

  Operator + ( a, b: Point ) c: Point;

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

It is necessary to enable "extended syntax" `(*$X+*)' when defining operators.

The Pascal-SC operators `+>', `+<', etc. for exact numerical calculations are not implemented, but you can define them. If you write a module which really implements these operators, please send it to us, so we can include it into the next distribution.

(And if you know more about modules in Pascal-SC than just their existence, please contact us either! We could probably easily implement them if we knew how they look like. Something quite close to Pascal-SC modules already *is* implemented as "GNU specific modules".)


Go to the first, previous, next, last section, table of contents.