Hmm, I'm hard-pressed to argue that point. If I were to come up with something else, I would argue that the lack of multi-method dispatch is a pretty big problem. Of course, that's sort of cheating because if you get that, it automatically implies proper argument handling and I therefore get two for the price of one :)
Unfortunately, I've seen those who have not had a chance to work extensively with MMD aren't terribly impressed by its benefits. My suggestion to them would be to take a program written in a language which supports this and try to port it to Perl. It leads to monstrosities like the constructor for AI::Prolog::Term:
sub new { my $proto = shift; my $class = CORE::ref $proto || $proto; # yes, I know what I'm doi +ng return $class->_new_var unless @_; if (2 == @_) { # more common (performance) return _new_from_functor_and_arity($class, @_) unless 'ARRAY' +eq CORE::ref $_[1]; } elsif (1 == @_) { my $arg = shift; return _new_with_id($class, $arg) if ! CORE::ref $arg && $ +arg =~ /^[[:digit:]]+$/; return _new_from_string($class, $arg) if ! CORE::ref $arg; return $arg->_term($class) if CORE::ref $arg && $ +arg->isa(Parser); } require Carp; Carp::croak("Unknown arguments to Term->new"); }
That constructor was buggy for a long time because Perl doesn't support MMD. It was very frustrating.
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: Perl 5's greatest limitation is...?
by Ovid
in thread Perl 5's greatest limitation is...?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |