On Wed, 24 Feb 2016, Flávio Etrusco wrote:

On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort <mar...@stack.nl> wrote:
In our previous episode, Mark Morgan Lloyd said:
> (remember recent discussion about IfThen pseudo-function).

More relevant to your situation, I remember discussion about adding an
identifier to WITH to use as an explicit shortcut, i.e. something like

with foo= bar do
   foo.someField := ...

Not relevant since the With code in this case must remain delphi compatible.

I, for one, would vote in favor making the documentation discourage
the use of 'with' and adding a warning in compiler...

I don't see why.

I use "with" extensively. I see nothing wrong with this useful construct.

The problem of the 'new identifier inserted in scope' exists, but is rare
enough for me to tip the balance in favour of using "with". It has maybe
happened once or twice in 25 years that I got bitten by it.

I find that perfectly acceptable.

For people that worry about this, the solution of Jonas should be ample to
detect/avoid mistakes.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to