In article <1992Nov16.080647.26783@informatik.uni-ulm.de>, borchert@titania.mathematik.uni-ulm.de (Andreas Borchert) writes:
> Agreed, programmers shouldn't be enforced to use VAR-parameters
> for reasons of efficiency only. But, even with the semantics of
> Oberon or Modula-2, it's not to difficult for the compiler to
> detect that your 1000 x 1000 array isn't modified and, thus,
> doesn't need to be copied.
>
> Usually, the calling procedure passes a reference to the array onto
> the stack in both cases and the called procedure then makes a copy
> of the array if you have call-by-value and your array parameter
> is subject to changes.
But what about a PROCEDURE p(a: Type; VAR b: Type) that is called as p(x, x). Both parameters will refer to x, but if b is modified, a should remain unchanged.