From: Hugh Sasse Staff Elec Eng Date: 2000-06-21T10:09:00+01:00 Subject: [ruby-talk:03577] Re: Static Typing( Was: Waffling between Python and Ruby) On Wed, 21 Jun 2000, Frank Mitchell wrote: > [...] (I also believe not specifying the *contract* of each involved > object's methods is a mistake. On a large-ish Objective-C system I worked > on we had a few bugs caused by passing the wrong object that just happened > to implement the right method in the wrong way. E.g. "price" as a message > to return an attribute vs. "price" as a command to initiate an involved > calculation with numerous side effects which fails because the object isn't > in a consistent state.) I'm not sure how one would solve this one. It seems to me that the caller would need to say something like object.price() unless "method price changes something" which is testing for the correct postcondition. (Changing the names to compute_price, and return_computed_price would work but when using objects designed by other people, these people can call the methods what they like, so you cannot rely simply on names.) Is there any way to test whether postconditions will be correct? > > Frank > Hugh hgs@dmu.ac.uk