[fpc-devel] Local variable names and colision with attributes/properties names

Marcos Douglas md at delfire.net
Thu Sep 27 18:52:53 CEST 2012


On Thu, Sep 27, 2012 at 12:34 PM, Graeme Geldenhuys
<graeme at geldenhuys.co.uk> wrote:
> On 2012-09-27 16:08, michael.vancanneyt at wisa.be wrote:
>>
>> The compiler helps you by forcing you to use a prefix in objfpc mode in
>> case you forgot.
>
> The change in FPC mode objfpc was definitely a good thing. I had code
> where a class had an Index property, and other methods of that class had
> an Index parameter name. Even though it was my own code, I had to triple
> check the method's implementation to find the real meaning when I used
> the Index identifier somewhere in that method.
>
> Now with the new language rule, I don't have such issues any more. Index
> will be the property name, AIndex will be the parameter, lIndex will be
> a local variable. Much simpler for my brain to process. :)

I never said this is wrong. I just said that could be a compiler
directive or something like that.

I agree that is much simpler... but why nobody, in another language,
do the same? Does not worth it? I do not know.

Marcos Douglas



More information about the fpc-devel mailing list