Perl6 Object Oriented Cookbook (v0.2.1)  
Section 9: Assertions and Invariants  
 
Recipe 9.9: Associating a Pre/Postcondition with a Particular Method Implementation
Last Updated: Sep 8, 2003
Status: Draft
      Previous Page   Next Page

How important is this problem to you?
  (Login to Vote)
5.00 Rating, 1 Vote  

How acceptable is the proposed solution?
  (Login to Vote)
0.00 Rating, 0 Votes  

Problem:  

You want to declare a pre/postcondition that is executed only for this implementation of the method -- it shouldn't be inherited by any subsequent implementations.

Solution:  

Declare the pre/postcondition as part of the method implementation, not the method interface:

Discussion:


Log In to Comment


Login / Edit User Info -- Copyright © 2002 Cognitivity -- Previous Page   Next Page