[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: User-defined Types

Robert Bruce Findler 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 ?!

> It's pretty easy when dealing with functions on flat values,
> but in object oriented languages and languages with higher-order
> functions (or any other interesting construct) these become very
> interesting questions. 

Mh, I'll have to ponder on that ...

> Eiffel is another language with these kinds of contracts (and 
> iContract is and adaptation of Eiffel to Java), if you're interesting in
> out these ideas in your own systems. 

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). What appealed to me with Euphoria was that
the runtime uses *user-supplied functions* to check the constraints.
Functions that allow you to use arbitrary algorithms. I thought this would
also add something along the line of realizing concepts of more general
predicates/invariants/contracts, as touched in another posting by Waldemar

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.

Maybe I have to look at DrScheme.