[fpc-devel] Suggestion: reference counted objects

Boian Mitov mitov at mitov.com
Sun Sep 21 19:17:49 CEST 2014


In general I would prefer to see this implemented with attributes rather 
than with new keywords. For god shake, we already have more keywords in this 
language than it is healthy. We should be extremely cautions when adding new 
ones.
That is one of the beauty of the attributes. They can eliminate a large 
number of keywords, and expand the language dynamically (trough the library 
not trough the compiler).
If you implement it with attributes, there is almost no need for any big 
changes in the compiler at least in the parsing side. Adding new keyword 
will probably propagate all the way to the tokenizer.

With best regards,
Boian Mitov

-------------------------------------------------------
Mitov Software
www.mitov.com
-------------------------------------------------------
-----Original Message----- 
From: Sven Barth
Sent: Sunday, September 21, 2014 4:12 AM
To: fpc-devel at lists.freepascal.org
Subject: Re: [fpc-devel] Suggestion: reference counted objects


=== code begin ===

type
   TARCObject = class refcounted(TObject)

   end;

=== code end ===

=== code begin ===

type
   TSomeClass = class(TARCObject)
     // ...
     Owner: TSomeClass weak;
     // ...
   end;

=== code end ===





More information about the fpc-devel mailing list