Passing arguments into functions - in, out, inout, const, and contracts
Deewiant
deewiant.doesnotlike.spam at gmail.com
Sun Feb 11 04:49:50 PST 2007
Jason House wrote:
> I believe that everything (except maybe fundamental types such as int)
> are passed by reference. I'd expect "in" parameters to be considered
> const, but I know that member functions can't be declared const.
>
> It seems to me that in/out/inout has no effect on how the language
> operates. I'm wondering how those affect the language. Does "in"
> impose a contract that the ending value must equal the starting value? I
> also haven't thought of any good way to differentiate out from inout
> from the compiler's standpoint (obviously, it makes sense to users).
Have a look at the doc: section "Function Parameters" at
http://www.digitalmars.com/d/function.html
After getting the code example improved via Issue 511, I feel it explains things
enough. Feel free to go file another Issue at
http://d.puremagic.com/issues/index.cgi if you believe it's still too unclear.
--
Remove ".doesnotlike.spam" from the mail address.
More information about the Digitalmars-d-learn
mailing list