[Grace-core] Structural Typing vs Specifications
Andrew P. Black
black at cs.pdx.edu
Fri Oct 14 12:27:44 PDT 2011
On 14 Oct 2011, at 10:14, Kim Bruce wrote:
> I agree with Andrew, though I have additional reasons. I agree that it is a non-problem in practice. I've never seen anyone confusing a cowboy drawing a gun and an artist drawing a picture in a program.
>
> My second reason is that to actually enforce the conformance of pre- and post-conditions is undecidable and would require a theorem-prover to come close to being useful. While I like Eiffel's requirements to "or" preconditions on to those of the superclasses methods and the "and" postconditions, this is not likely to be of any use with structural types.
>
I was imagining a mode — maybe the default mode, maybe not — in which pre-and post conditions were checked dynamically. My point was that the self.gun.hostered message would be an error. Not an assertion failure, but an error.
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20111014/b30f781c/attachment.html>
More information about the Grace-core
mailing list