Communicating between in and out contracts

Christopher Wright dhasenan at gmail.com
Sat Oct 17 06:19:57 PDT 2009


Rainer Deyke wrote:
> Rainer Deyke wrote:
>> Andrei Alexandrescu wrote:
>>> I honestly believe the whole "old" thing can't be made to work. Shall we
>>> move on to other possibilities instead of expending every effort on
>>> making this bear dance?
>> It definitely /can/ be made to work, for some value of "work".  It
>> sacrifices the natural order of evaluation to gain a concise and
>> intuitive syntax.  I don't think it should be dismissed out of hand.
> 
> Also, from the Eiffel docs
> (http://archive.eiffel.com/doc/online/eiffel50/intro/language/invitation-07.html):
>   The notation 'old  expression' is only valid in a routine
> postcondition. It denotes the value the expression had on routine entry.
> 
> It seems that Eiffel had 'old' semantics that I've proposed all along.
> Any significant problems with this approach would have been discovered
> by the Eiffel community by now.

It requires duplicating the object. If the object is mutable, this 
requires duplicating it and recursively duplicating everything it 
references. If the object is immutable, this is free.



More information about the Digitalmars-d mailing list