[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: User-defined Types
At Thu, 18 Jul 2002 11:28:16 +0200, "Herchenroeder, Thomas" wrote:
> > This approach, as Shriram points out, has been around for a long time.
> Yep, but since "old" doesn't equal "bad", I guess everybody here thinks this
> approach has more general flaws, right ?!
I don't! It's dynamic, so it has more information and can pinpoint
defects more precisely, but it's dynamic so you don't get a guarantees
for all program executions (only for the ones in your test suites).
> It's been quite a while since I have been looking into Eiffel. My
> general impression so far in the issue was that all efforts in this
> direction (like 'contracts' in Eiffel) seemed not generic enough,
> both in terms of what they cover and how the concept is realized in
> the language. (E.g. you might only be allowed to use expressions).
In DrScheme, you can use user-defined functions as predicates. In
Eiffel, I was under the impression that you could call methods from the
contract specs, but I don't have it installed anymore to double-check.
> In general, I would be very happy to have a generalized predicate system in
> a language that bombs at runtime when a constraint has been violated, and
> then I'd dive into the usual debug/trace/analysis cycle to get hold of the
> bug (to find "whose should be blamed for", as Robby put it). Although this
> might not add to static reasoning about or proving properties of the code.
> It would just practically be very helpful.
The contract system should be able to tell you *automatically* whose
fault it is! (under the assumption that the predicates are correct).