Indeed. Sorry for having disseminated FUD. My only defense is that it had been a while since I read Apo4 and I had forgotten about PRE and POST blocks.
One question that I couldn't answer from my (quick) reappraisal of Apo4. Is there any intent that PRE & POST blocks will be "turn-offable" (with apologies to the BG ads) via command line switch or other similar mechanism?
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
PRE and POST will obviously handle pre-/post-conditions for methods. However - I've not spotted an easy way of expressing class invariants. Is there something that I've missed?
Also, there do not appear be a built ins for dealing with naming conflicts as there are in languages like Eiffel. How would I rename method foo() to bar() in a sub-class and keep the pre- and post-conditions?
Disclaimer: I've still not read A12 properly, so apologies if the answer is in there and I missed it when I skimmed it :-)
It should be possible to do class invariants one way or another. Perhaps we could just say that any PRE and POST properties on the class itself automagically get attached to any methods defined in the class.
As for naming conflicts, A12 does talk about that some in the context of Roles, but similar reasoning applies to inherited methods. In general, renaming violates Liskov substitutability, so we discourage (but do not prevent) that approach in favor of distinguishing via multiple dispatch where possible, and use of a switch method where not. But in cases where renaming is used, it'll be important to make sure the correct PRE and POST are called at each level. If renaming is done simply by a wrapper method in the derived class, this will happen automatically, I suspect.
Nonetheless, if you're changing the contract of a class,
you probably ought to consider delegation instead of inheritance. And the delegation mechanism certainly has plenty of hooks for renaming.