[fpc-devel] Initialize/Finalize management operators and Default intrinsic

Michael Van Canneyt michael at freepascal.org
Tue Apr 12 14:48:19 CEST 2016



On Tue, 12 Apr 2016, Sven Barth wrote:

> Am 12.04.2016 12:01 schrieb "Maciej Izak" <hnb.code at gmail.com>:
>>
>> another way is to introduce attributes for selected language elements in
> Delphi compatible way. For example in Delphi we have:
>>
>>   TCustomAttribute = class(TObject)
>>   end;
>>   WeakAttribute = class(TCustomAttribute);
>>   UnsafeAttribute = class(TCustomAttribute);
>>   RefAttribute = class(TCustomAttribute);
>>   VolatileAttribute = class(TCustomAttribute);
>
> What I don't like about such a usage of attributes (aside from the syntax,
> but that's an orthogonal problem) is that the compiler needs to be made
> aware of each and every special attribute... (yes, it also needs to support
> each keyword, but in the case of keywords it doesn't have to be somehow
> defined in some units as well)
> [Note: this is less a "I don't want it", but a "I don't like it"]

I really don't think you should delegate such things to attributes. 
You make 2 completely unrelated language constructs suddenly related. 
A bad design decision.

Michael.



More information about the fpc-devel mailing list