develooper Front page | perl.perl6.language | Postings from June 2005

Re: SMD is for weenies

Thread Previous | Thread Next
From:
Yuval Kogman
Date:
June 30, 2005 21:27
Subject:
Re: SMD is for weenies
Message ID:
20050701042707.GH23213@woobling.org
On Fri, Jul 01, 2005 at 13:42:34 +1200, Sam Vilain wrote:
> Yuval Kogman wrote:
> >As I understand it SMD is now not much more than a mechanism to
> >place a constraint on the MMD, saying that there can only be one
> >method or subroutine with the same short name.
> >Why is this the default?
> 
> Otherwise you lose this quite useful warning if the signatures didn't
> match;
> 
>     method foo redefined at ...

That's a good point...

I'm guessing that the default warnings should have a warning for MMD
methods which append to a short name without appearing immediately
after each other in the same file.

> I agree with you MMD is very cool, and I use it a lot.  But I don't
> mind clarifying the intent with "multi"; this "overloading" is
> considered by some to be surprising to new programmers.

Prepending 'mutli' is not a problem when I have to type it. It's a
problem when others won't type it. When 90% of the module code I'll
be using is not MMD compatible, because MMD is not the default, I
can't specialize other people's code without editing it (at runtime
or at the source level).

Overloading won't happen unless people overloading semantics are
introduced, and that's exactly what I'd like to do to other people's
code occasionally.

As for the suprising factor, I can argue that Perl 6 is surprising
already, and that overloading like behavior should not happen unless
people try to achieve it.

However, I'd expecet naive use of MMD to also work, since java and
C++ provide more primitive but like-minded tools themselves.

-- 
 ()  Yuval Kogman <nothingmuch@woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: /me wields bonsai kittens: neeyah!!!!!!!!!!!!!!!!


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About