[fpc-pascal] Name of a var

Sven Barth pascaldragon at googlemail.com
Tue Nov 22 18:49:09 CET 2011


On 22.11.2011 12:42, Marco van de Voort wrote:
> In our previous episode, Sven Barth said:
>>> is more work than
>>>
>>> VarName:='counter';
>>>
>>> So what's the point ?
>>
>> The best argument for such a feature is that the name is checked by the
>> compiler.
>> If I change the declaration of the variable the compiler will complain in
>> the first case, but not in the second (let's assume that we don't need to
>> care about some kind of backwards compatibilty, just because we wrote the
>> identifiers to a file in different versions of the application were the
>> variable had different names).
>
> The first or the second invocation of sendinteger ? :-)
>
> sendinteger(nameofvar(var1),var2);
>
> is an easily made mistake (copy and paste like).

I'm a huge fan of synchron edit in Lazarus :P


> So I have some doubts about this argument.

The Pros are very few, I admit. Another reason (the other mailed as an 
answer to one of Martin's mails) why this is a low priority feature for 
me and I'll implement other "gems" first ;)

Regards,
Sven



More information about the fpc-pascal mailing list