Hans-Peter Diettrich wrote:
Marcos Douglas schrieb:

IMHO, 'with' should have an implicit pointer like 'self' (could be
'this' or whatever).

This<g> will fail with nested With's, or a With with multiple expressions.

A nicer syntax would require only an "." for your "this.".

Eg:

procedure TControlDescendant.Paint;
begin
  with Canvas do
  begin
      this.Rectangle(0, 0, this.Width, this.Height);
        .Rectangle(0,0, .Width, .Height);
  edn;
end;

One I've floated elsewhere is to allow with to define an alias with the same notation as a constant:

  with tsm= TSming(caller^) do begin
    while tsm.Count <= writePos do
      tsm.Append('');

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to