[fpc-devel] class abstract, class sealed implementation. please review.

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Oct 16 23:11:52 CEST 2009


2009/10/16 Paul Ishenin <webpirat at mail.ru>:
>
> I tried to implement support for delphi sealed and abstract classes. They
> are described a bit here: http://edn.embarcadero.com/article/34324

Delphi's "sealed class" example is slightly flawed. :-)

----------------------
Classes marked as sealed cannot be inherited from.

type
  TAbstractClass = class sealed
    procedure SomeProcedure;
end;
---------------------------

The class name suggests that it is an abstract class, meaning you
cannot use the class as-is, you need to create a descendant so you can
actually implement "SomeProcedure". Why else would they call the class
"AbstractClass". But by the "sealed class" rules, you cannot create a
descendant. So now you have a class you can do absolutely nothing
with! :-)



-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list