|
 |
Warp wrote:
> Orchid XP v8 <voi### [at] dev null> wrote:
>> Eiffel has preconditions *and* postconditions, which most people don't
>> seem to bother checking with assert() calls.
>
> A little thought experiment: How would you write a comprehensive
> postcondition to a function that sorts a list/array of elements?
Trivial.
Forall(i < length-1) assert(j[i]<=j[i+1]);
Basically, the definition of sorting. Of course, you need to be able to put
qualifiers in your assertions.
--
Darren New, San Diego CA, USA (PST)
Eiffel - The language that lets you specify exactly
that the code does what you think it does, even if
it doesn't do what you wanted.
Post a reply to this message
|
 |