develooper Front page | perl.perl5.porters | Postings from December 2008

Re: Proposal: Named parameters for 5.12

Thread Previous | Thread Next
Matt S Trout
December 6, 2008 07:46
Re: Proposal: Named parameters for 5.12
Message ID:
On Fri, Dec 05, 2008 at 01:23:06PM -0800, Chip Salzenberg wrote:
> What say we make named parameters part of Perl 5.12?  (Finally?!)
> A quick check of CPAN suggests that Schwern's code in Method::Signature
> defines the state of this particular art.


The state of the art is defined by:

rhesa's Method::Signatures::Simple
rafl's MooseX::Method::Signatures

which are all being used for production code[0] - the last one is based on
gaal's Perl6::Signatures work although we'll probably move it to its own
custom parser at some point. This is what's likely to be supported by default
in future Catalyst/DBIx::Class stuff and MooseX::Declare.

Schwern's stuff is basically a prototyping land and has shown a lack of
stability - Method::Signatures::Simple was a reaction to it failing to install
on win32 when the Data::Alias stuff was first introduced and a desire to
keep things relatively minimal until Moose-land has had a chance to really
shake out what we want from a larger feature set.

However, I'm not sure this is how we should be looking at the problem. What
I'd really prefer to see is a way to allow pluggable signature parsers as
a pragma (which I think is roughly where rafl's is going) and
provide a simple default along the lines of Method::Signatures::Simple's

At the very least, we should do that -first- and keep an eye on what stabilises
out on CPAN before considering bringing anything more complex near the core.

[0] admittedly in the case of MX::Method::Signatures only under controlled
conditions with a subset of the syntax so far - the documented syntax in that
module is considered largely stable now, although we're not encouraging wide
use yet.

      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director          
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?  

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About