[Perl5-syntax] Method::Signatures, now with types

Michael G Schwern schwern at pobox.com
Mon Mar 21 23:47:04 GMT 2011


MS is still missing a bunch of features of MXMS, so it's not drop in
compatible.  Since the choice should be lexical that should be something we
just document.

Specifically what's missing...

* where constraints
* labels
* "does coerce"
* placeholders

Where constraints are definitely going in same as MXMS and Perl 6.
https://github.com/schwern/method-signatures/issues#issue/7

Placeholders and labels have not been discussed.

"does" will be replaced by "will" as the alternative trait keyword, same as
Perl 6.  "does coerce" will not be special cased in MS but it will be possible
to do so in a subclass.  There's no urgency on this one, and I'm not 100% sure
Perl 6 is settled on it.

MS also does a few things which are incompatible with MXMS, such as loading
methods at compile time.  This may interfere with MXD.  We're planning an
option to turn that off.
https://github.com/schwern/method-signatures/issues#issue/8

Finally, MS and MXMS don't seem to play well together in the same file.


On 2011.3.22 7:42 AM, Nick Perez wrote:
> +1
> 
> I've not dug into the tests yet, but this is a major accomplishment.
> I'll see about possibly adding in the ability to choose at import in
> MXD the ability to use this over MXMS. Shouldn't take too much since
> the underlying mechanism is the same. 
> 
> On Tue, 22 Mar 2011 01:03:11 +1100
> Michael G Schwern <schwern at pobox.com> wrote:
> 
>> Barefootcoder just completed work on a type system for
>> Method::Signatures backed by Any::Moose.  It's released as an alpha.
>> https://github.com/schwern/method-signatures/tree/v20110322.0027_001
>>
>> The syntax is as discussed here, but the "$param isa Class" and
>> "$param does Role" disambiguating traits have not been added.
>>
>> Initial benchmarking shows a 10x speed improvement over
>> MooseX::Method::Signatures running the MXMS synopsis code.
>> https://gist.github.com/879481


-- 
package Outer::Space;  use Test::More tests => 9;



More information about the Perl5-syntax mailing list