[fpc-pascal] with statement using mulltiple objects
Philippe
philippe at quarta.com.br
Tue Sep 16 12:26:24 CEST 2014
could the compiler avoid "with" pitfalls?
now the compiler attach
a property to the closest "with" where it finds it.
the compiler could
check if the property appears in another "with" of the "with" stack and
produce a message (hint, warning or error, which may be configurated).
is not it a way to make the "with" safe?
Em 16.09.2014 05:44,
Frederic Da Vitoria escreveu:
> 2014-09-14 16:23 GMT+02:00 Mark Morgan
Lloyd <markMLl.fpc-pascal at telemetry.co.uk>:
>
>> I'd be far happier if
there were provision for declaring a temporary "shortcut" symbol:
>>
>>
with shortcut: TSomething= TreeRoot.SubDirs[Low(TreeRoot.SubDirs)]^
do
>> begin
>> shortcut.DirLogged := true;
>> shortcut.DirHatFocus :=
false;
>> shortcut.SubDirsExpanded := true;
>
> Yes, something close to
alias in SQL, instead of plain elision which "with" currently performs.
This would allow for a clearer writing without the pitfalls of the
Pascal "with".
>
> --
> Frederic Da Vitoria
> (davitof)
>
> Membre de
l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org [2]
>
>
_______________________________________________
> fpc-pascal maillist -
fpc-pascal at lists.freepascal.org
>
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [1]
Links:
------
[1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[2]
http://www.april.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140916/3ac0cf7e/attachment.html>
More information about the fpc-pascal
mailing list