[fpc-pascal] deprecated syntax is inconsistent.

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Apr 29 11:30:11 CEST 2010

On 29 Apr 2010, at 10:52, Graeme Geldenhuys wrote:

> Marco van de Voort het geskryf:
>> In our previous episode, Graeme Geldenhuys said:
>>> Why is the usage of 'deprecated' inconsistent, depending where you  
>>> use it.
>> As always, because Delphi does. See the recently submitted fcl-passrc
>> bugreports for more examples.
> Shouldn't that inconsistent syntax be limited to the Delphi compiler  
> mode
> only? Like many other things are.

The general reason for putting modifiers before the semicolon in case  
of type declarations is that there can be ambiguity in other cases  
(modifiers are not reserved words, so in principle the modifier can  
also be used as a type or variable name).

In case procedures/function/method declarations, this is not the case  
since an identifier can never follow a function/procedure/method  
declaration: they have to be preceded either by
* "procedure"/"function" for routine declarations
* by "var"/"const"/"type" for var/const/type declarations
* by "property" for property declarations
* by "public"/"(strict) protected"/"(strict) private for field  

Conversely, adding it before the semicolon in case of procedure/ 
function declarations would be inconsistent with how other modifiers  
have always been used there.

So no, it should not be changed in FPC mode like many other things  
have been changed in the past, because it would have to be changed  
back later anyway (just like http://wiki.freepascal.org/User_Changes_Trunk#Passing_derived_classes_to_var-_and_out-parameters 
, http://wiki.freepascal.org/User_Changes_2.4.0#Order_of_field_and_method.2Fproperty_declarations 


More information about the fpc-pascal mailing list