When I call your example as "add (C1,C2,C1)", then C1 will be changed. The compiler cannot detect that, it does not know that two parameters are at the same address.
It depend on what C1 you talking about, the first stay unchanged the second, where the programmer chooses to write to, will be written to.
Dont you understand stand we turn in circles?
3 arguments, 3 variables, but just one where your method writes to.
So if you call Add(c1, c1, c1) what in your world of logic should happen? Are you now saying that it would write 3 times to c1 or do you finally accept my first given answer that the developer is in charge about what variable will be used as output and only the last c1 (variable c internal) is the one where the writing happen?
Add(
constref a: Integer; // this will be passed by reference to maybe do compare address with "c" -> unchangable
const b: Integer; // this will be passed by value, no checks beside for value are possible -> unchangable
out c: Integer; // this is passed by reference and its the only variable where you can write to -> changable
);
So the compiler knows, aha! Variable "c" is open to be modified, also the compiler knows that "a" and "b" are read-only.
If you think that Add(c1, c1, c1) would all be treated as "a" than you are total wrong.
So what did I told.....
If on the other hand you as developer call such method in a (a, b, a) way, then its upon you to decide if its smart or not.
[/quote]