[fpc-pascal] a proposal about "with" syntax

Ralf A. Quint FreeDOS at gmx.net
Mon Mar 18 18:15:02 CET 2013


At 10:03 AM 3/18/2013, Jürgen Hestermann wrote:

>Am 2013-03-16 07:13, schrieb Xiangrong Fang:
>>I would like to do this:
>>
>>with MyClassInstance as mci, SomethingElse do begin
>>   Caption := 'A new caption';
>>   for i := 0 to Count - 1 do
>>     mci[i] := UpperCase(mci[i]);
>>end;
>>
>>That is, to add an optional "as" clause to the 
>>with statement so that access array element in a structure is made easier.
>I fail to see how this would be helpful.
>It's just more confusing.
>Suddenly there are 2 (or more?) identifiers meaning the same thing.
>If I want to avoid typing a long identifer name multiple times
>I would simply select it and copy it to the clipboard.
>If someone (I myself?) chose a long identifier 
>name I think it was for some reason (readability?).
>Foiling this by making the code more obscure is not a good idea IMO.
>That's making the code a bit more C'ish (harder to read).
>You won't cripple down all variables to one 
>letter names A, B, C only because this is easier to type, won't you?

+1

I don't see either why a programming language 
needs to be changed to support the laziness of some programmers.

But in recent months (years?) it seems more and 
more folks in here don't wont' to program in 
Pascal anymore and come up all the time with "new 
and improved" features that render the advantages of Pascal useless...

Ralf 




More information about the fpc-pascal mailing list