[Lazarus] 'with' is evil, isn't it?

Sven Barth pascaldragon at googlemail.com
Fri Aug 5 11:29:51 CEST 2011


Am 05.08.2011 11:23, schrieb Luca Olivetti:
> Al 03/08/11 17:08, En/na Lukasz Sokol ha escrit:
>
>>
>> Except that in the with construct the named alias will not be an
>> instance of variable, but rather a way of _naming_ it shorter, an _alias_;
>> I agree that making it a variable will create all sorts of problems
>> regarding memory management, lifetime management and so on; but
>> the named alias would only live in the block following the
>> with, and could be forced to be strong-typed too. Think plaintext substitution
>> before compilation...
>
> And it's not a new idea either: texas instruments' pascal for the 9995 had it
>
> (though it was 20 years ago and I don't remember the exact syntax, I think it was
>
>    with a=some.structure,b=some.other.structure do
>
> instead of
>
>    with a:=some.structure,b:=some.other.structure
>
> but my memory could be wrong).

Well... if another Pascal dialect had it the changes might be higher 
that it gets integrated into FPC.

So it might be useful to research the exact with syntax of Texas 
Instruments' Pascal.

Regards,
Sven






More information about the Lazarus mailing list