On Thu, Oct 03, 2002 at 06:46:14PM -0400, Michael G Schwern wrote:
> I see us already smashing too many things into the method signature as it
> is.  It will rapidly get messy if you have a method with a complex signature
> and a handful of attributes and preconditions.

I think I have my own counter example.

Consider defining an abstract class with an interface and I want to put some
conditions onto an abstract method.

     class Abstract::Human is interface {
         attr head, shoulders, knees, toes;
         invar { .head == 1 }
         invar { .shoulders == .knees == .toes == 2 }
         
         method eat ($food) is pre  { !$food.isa('Poison') }
                            is post { .return eq 'Burp' }
     }

since I have no method body for eat() I have no choice but to hang it off
the signature as an attribute.

So conditions do have to go on the signature, but I still like the option of
their being in the body as well, especially given the problem of wanting to
put post conditions at the end.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Cottleston, Cottleston, Cottleston Pie.
A fly can't bird, but a bird can fly.
Ask me a riddle and I reply:
"Cottleston, Cottleston, Cottleston Pie."

Reply via email to