[fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)
Flávio Etrusco
flavio.etrusco at gmail.com
Wed Feb 24 13:50:55 CET 2016
On Wed, Feb 24, 2016 at 9:00 AM, Michael Van Canneyt
<michael at freepascal.org> wrote:
>
>
> 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.
I loved 'with' while I was learning Delphi/Pascal and hated after the
first few months since using it professionaly. I truly believe it
warrants/deserves some advice in the documentation, for the beginners.
With the code completion in Lazarus there's even less reason to use it
- besides any possibly missing compiler optimization...
Best regards,
Flávio
More information about the fpc-pascal
mailing list