[fpc-devel] Suggestion: reference counted objects

August Oktobar augustoktobar at gmail.com
Tue Sep 23 19:35:11 CEST 2014


To somebody (probably Sven):

In FPC there is concept of stack based objects (object) that behave like
classes (with inheritance)?
Why not just extend this object with support for constructors and
destructors, and there is no need for the ARC?

On Mon, Sep 22, 2014 at 2:05 PM, Hans-Peter Diettrich <DrDiettrich1 at aol.com>
wrote:

> Sven Barth schrieb:
>
>> Am 22.09.2014 09:47 schrieb "Michael Schnell" <mschnell at lumino.de
>>
>
>   > Why not use "interface" to add ref-counting to an object ? This seems
>> to work nicely even though the name "interface" in not "speaking" on that
>> behalf.
>>
>> Because you'll need to declare an interface for each class you want to
>> have reference counted so that you can access its methods, properties, etc.
>>
>
> This overhead could be eliminated by another syntax extension, like
>   TMyARCclass = interface(TObject)
> where the Compiler could allow for implementations of the declared methods
> just as for
>   TMyARCclass = class(TObject)
> bridging the gap between traditional (strictly declarative) interfaces and
> classes (including implementations), with or without ARC.
>
> DoDi
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140923/73c1610d/attachment.html>


More information about the fpc-devel mailing list