Several problems, including:
1) "Out" is already used in C# (and UML, Ada, PL/SQL,...) to refer to the
method parameter itself -- the reference -- rather than the object to
which it points. (The distinction between references and objects _is_
vital to the semantics, and confusion between the two has historically
caused trouble.)
2) "Out" does not apply to references other than method parameters, such
as those returned from a method, stored in instance/class members,
and local variables.
"Simon Trew" <ten.egnaro@werts> writes:
Ada uses "in", "out", and "in out". Some people might be skeetish about this
and say that the "objects" passed are values, they are just the values of
the references-to-object, but that is by the by I think as far as the
semantics of the thing are concerned. I think "In", "Out", and "In Out" are
common enough, and although it is late I seem to recall they occur in the
proposed Action Semantics addendum(?) to the UML.
S.
Andrew R. Thomas-Cramer <ar**@shell.core.com> wrote in message
news:vg************@corp.supernews.com... C#, like Java, fails to provide a const-qualifier for references for
compile-time const checking.
In Java, I used to document intended const-qualified references (e.g.,
method parameters) with C++ syntax: "const*". Does anyone have a better
suggestion, for C#?
The best I've come up with is "OBJECT READONLY", but that overloads an
existing C# keyword that means something else.
andy thomas-cramer