>
> >  I don't know what's make it complex if there are 2 or more subject in
> the with?
>
> Context. A conflict case the two object were of the same class.
>

Are you saying this case:

with MyClassInstance1 as m, MyClassInstance2 do begin
  m.Property1 := 123;
  Property2 := 456;
end;

Here you don't know Property2 belongs to which object instance??  If so,
this is not a problem at all, because even without "as" you still cannot
distinguish, so the compiler should deny this kind of usage anyway,
however, with "as", you can do this:

with MyClassInstance1 as m1, MyClassInstance2 as m2 do begin
  m1.Property1 := 123;
  m2.Property2 := 456;
end;

To summarize, "as" does NOT try to eliminate context ambiguity (also it
won't make a clear context ambiguous), but provided some convenience when
needed.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to