[fpc-devel] is not operator

Martin Frb lazarus at mfriebe.de
Fri Sep 11 16:42:06 CEST 2026


On 11/09/2026 16:31, Mattias Gaertner via fpc-devel wrote:
> Although I am often unhappy with Embarcaderos syntax choices, the "is 
> not" I like. It looks Pascal, does not bite existing code, is easier 
> to read, and is easy to implement.

Well: "does not bite existing" is technically incorrect. Albeit in 
practice it should be true. (and also, I wouldn't mind the new op)

The below does compile. And it contains "is not".
Never mind, I can't imagine how to fill in the empty bits to make this a 
useful construct.

program Project1;
{$Mode objfpc}
type
   TFoo = class end;
   TFooClass = class of TFoo;
   TObjClass = class of TObject;

operator not(o: TFooClass): TObjClass;
begin
end;

var a: TFoo;
begin
   writeln(a is not TFoo);
end.



More information about the fpc-devel mailing list