Output contract's arguements

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Fri Sep 20 11:14:39 PDT 2013


On 20/09/13 18:50, monarch_dodra wrote:
> 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.

Yup.  But this is why I think it makes sense for a variable x in the 
out-contract to always mean "the final value of x at the end of the function". 
If _for reference types_ the out-contract sees the changed value, that should be 
true for all types, otherwise it's an inconsistency that is going to bite people.

Then, in addition, you should be able to have an explicit request (x.in, x.old 
...) for the initial value (as you needed in your contract).


More information about the Digitalmars-d mailing list