[fpc-devel] Proof of Concept ARC implementation

Michael Van Canneyt michael at freepascal.org
Mon Oct 27 11:54:55 CET 2014



On Mon, 27 Oct 2014, Kostas Michalopoulos wrote:

> 
> On Mon, Oct 27, 2014 at 11:32 AM, Michael Schnell <mschnell at lumino.de> wrote:
>
>       So you suggest cyclic references should be forbidden (erroneous programming technique). Are they ?
> 
> 
> IMO if a program takes care to avoid cyclic references (with a heaptrc-like unit to find such cases), it shouldn't pay for the overhead that a detector would have. Of course i'd
> make that a compiler directive (or some global flag) since others may not care.
> 
> @Sven:
> TBH i don't feel that strongly (heh) about the syntax. It just looks weird to me compared to other keyword usage in Free Pascal. If at least there was a semicolon after the type
> it may look more consistent (after all, cdecl, extern, etc are placed after a semicolon). F.e.
> 
> Foo: TFoo; weak;
> 
> But that probably wont work well with function arguments. After all there aren't "cdecl", "extern", "static", etc function arguments.
> 
> Is there any other such use of a keyword? I think it is a bad idea to introduce a new keyword placement if there isn't already one since it breaks consistency (all those other
> keywords are placed in front of the type name whereas this special one is placed after).

as far as I can see, the proposal of Sven is perfectly in line with existing constructs and does not break consistency.

var
   a : something deprecated ; cdecl; external 'x';

Fields in classes:

   aa : integer implementation; static;

etc. Modifiers are always placed after the thing they modify.

Reference counting behaviour for function arguments is already controlled through const, var and out, 
so I don't think a new keyword needs to be used for them.

Michael.



More information about the fpc-devel mailing list