[fpc-pascal] Operator overloading with Text labels or words
Michael Van Canneyt
michael at freepascal.org
Mon Jan 30 09:13:37 CET 2017
You can use words.
But only words that the compiler defines. See the documentation.
On Mon, 30 Jan 2017, Lars wrote:
> It's not possible to define an operator like:
> Operator AbcXyz(r : real; z1 : complex) z : complex;
> Is it?
> Has to be a symbol?
> If one could use words or text as operators this might be very
> interesting, although, probably a double edged sword like Lisp where you
> could embed programming languages inside programming languages.
> For example:
> x := 4 PLUS 4;
> Prints 8..
> Operator Plus(...);
> So you just invented Cobol inside fpc or something like cobol. Bad example..
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal