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: [email protected]
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 ===


_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to