[fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)
Michael Van Canneyt
michael at freepascal.org
Wed Feb 24 13:00:24 CET 2016
On Wed, 24 Feb 2016, Flávio Etrusco wrote:
> On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort <marcov at 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.
More information about the fpc-pascal
mailing list