What's wrong with each providing a run method?
Nothing. However, there is a LOT wrong with weakly typed variables and not requiring arguments to be of certain types, just because they all have 'run' methods does not mean I should be able to interchange programs and dogs. That's just asking for trouble.
As for getters and setters, can you think of any popular language with OO features that doesn't allow them?
I think you meant to say, is there any language that absolutely requires them? In which, no. The argument was in reference to prior comments of Perl OO's system being flexible. My comment was, essentially, as long as Perl doesn't do anything stupid like require getter/setter methods (it won't), I'm ok with a more rigid object structure.
Can you provide an example?
Dog::chewPantleg(Person ted) { # implementation }
In the above example, you can't have a Dog chew another Dog's pantleg. It's enforced that the argument is a person.
If you're referring to prototypes (I don't think you are)
I am, however weak the current implementation is, that's what I'm talking about. Perl seems to allow OO implementation (a little better than how GTK might implement pseudo-OO in C), but it does not embrace it in spirit. I'm not saying it should be enforced, but it should be embraced.
Then you should be aware that those are checked at compile time while method dispatch is resolved at runtime, thus making prototypes useless on method calls.
I'd like to see that change in Perl6. Maybe it's a pipe dream, but it seems to be a requirement for clean polymorphism.
In reply to Re: Re: Re: Re: perl6 & OO
by flyingmoose
in thread perl6 & OO
by chance
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |