Output contract's arguements

monarch_dodra monarchdodra at gmail.com
Fri Sep 20 09:50:52 PDT 2013


On Friday, 20 September 2013 at 16:38:36 UTC, H. S. Teoh wrote:
> True. I agree that redefining plain "x" to mean "initial value 
> of x"
> would be difficult to implement for ref arguments

I think it would be wrong to boot. "ref" is an indirect type, 
like a pointer. Changes made to "it" (eg the reference'd value) 
*need* to be seen in the out contract. I don't think it makes 
sense to talk about "the old value of the reference". That'd be 
like asking for the old value of what a pointer was pointing to.


More information about the Digitalmars-d mailing list