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

Re: MMD as an object.

Thread Previous | Thread Next
From:
David Storrs
Date:
March 10, 2005 17:40
Subject:
Re: MMD as an object.
Message ID:
20050311014031.GA75801@megazone.bigpanda.com
On Thu, Mar 10, 2005 at 02:22:20PM -0600, Rod Adams wrote:
> David Storrs wrote:
> >On Wed, Mar 09, 2005 at 03:38:52PM -0600, Rod Adams wrote:
> >>  use Foo; # from above, exports &bar is MMD::Random
> >>  multi sub bar {...}
> >>
> >>Does this generate an error, since one could expect this particular &bar 
> >>to be Manhattan? Or does it assume Random, since there's already a &bar 
> >>in existence? 
> >
> >This seems like action-at-a-distance to me; 
> >
> Well, if you were not expecting Foo to export some &bar's, then you're 
> in for a surprise regardless of dispatch when you call &bar in your code 
> and one of Foo::bar gets called instead of one of yours, because it was 
> a closer match.
> 
> I would say that people should know what they are getting into when they 
> C< use > something. 


What I'm hearing you say here is "Yes, it's action-at-a-distance, but
it's your job to make sure it doesn't trip you up."  The problem that
I see is that I may well be able to keep track of everything from the
modules I import, but what about the ones THEY import...and the ones
THEY import...and so on.  In a medium-to-large software project, that
can get to be a lot of modules, very quickly.

--Dks

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