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

Michael Schnell mschnell at lumino.de
Wed Aug 3 16:34:45 CEST 2011


On 08/03/2011 02:00 PM, Alexander Klenin wrote:
> with a := MyCompomentList[0] do begin
>    Rectangle(0, 0, a.Width, a.Height);
> end;
Here defining a as a pointer would do away with the with and the begin 
.. end.

By allowing for C-like defining of cariables we could write something like


   var a TMyPointer := MyCompomentList[0];

  Rectangle(0, 0, a.Width, a.Height);


(this might or might not be a good idea)
- Michael






More information about the Lazarus mailing list