Re: Perl 6 modules plan

[email protected] (Michael G Schwern) Tue, 14 Aug 2001 11:16:18 -0400
Newsgroups perl.perl6.stdlib
Message-ID <20010814111618.C7945@blackrider>
On Tue, Aug 14, 2001 at 09:55:37AM -0500, Garrett Goebel wrote:
> > There should be ONE calling style for each sub/method. 
> > Allowing this _will_ cause different people to use different
> > calling styles and also possible confusion.
> 
> It gives us a cleaner way to mix and match order dependant and named
> parameter lists. Not to mention the potential for optimization hints,
> parameter type checking and constraints (no auto-vivication), lazy
> evaluation, etc.

I think you misunderstand.  This isn't named parameters vs prototyped
parameters vs args as list.  The problem is the idea that functions
should accept *multiple styles by default* which the proposed
Module::Interface does.

        foo($this, $that, $whatever);

        foo( this     => $this,
             that     => $that,
             whatever => $whatever
           );

Saying that most core functions should be callable both ways is
overkill.  This is what CGI.pm does (for historical reasons, I
believe, and not by design).  It's unnecessarily confusing and
requires a not insignificant amount of life-support to make work.

Having Module::Interface around to do this sort of thing when desired
is nice, but please don't cannonize it.


PS I shudder to think what will happen with an even number of
arguments in the Module::Interface scheme.

-- 

Michael G. Schwern   <[email protected]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[email protected]>	     Kwalitee Is Job One
Kids - don't try this at--oh, hell, go ahead, give it a whirl...