Method::Signatures: here a tweak, there a bugfix
Just a quick note to say that I’ve released a new version of Method::Signatures today. There’s nothing major, just a few housekeeping duties. Here’s the highlights:
- Previously, you weren’t able to mix alias parameters and named parameters. Now, thanks to a patch from the Damian and schwern fixing a buglet on 5.8 and 5.10 that had confounded me for the past month or so, you can.
- Previously, run-time errors were pretty nice looking, with fairly precise line number reporting. The compile-time errors, such as the ones you get when your signatures don’t parse correctly, were not as nice. This is fixed now (this is the only one I actually did myself).
- If you’d like the run-time errors to do something other than
die
, you can now override the newsignature_error_handler
method in a subclass. Thanks to larryl for the patch. - Our use of Data::Alias was causing a bug when used in conjunction with threads. Happily, schwern has put in code which will only load Data::Alias on demand, avoiding the bug at least in the cases where you use threads but not alias parameters, and also speeding up our compile-time performance a bit.
Hopefully you find these tidbits helpful. Let us know—here, on GitHub, or in an RT ticket—if you see any problems, or want to make any suggestions. Enjoy!
Much appreciated, as always!
Method::Signatures must be the most important new module for Perl right now.
Thanks for the kind words guys. I especially want to thank Ross for saying:
Of course, to be fair, schwern wrote the original version of MS back in 2008. I've just been working on making it even more useful in our Mo[ou](se)? filled world.
To that end, everyone should definitely head on over to the GitHub issues page (linked above) and tell us what features you'd like to see. Drop a "me too" into an existing issue so we can see what the most popular ones are, or start your own. We're definitely anxious to see MS become the gold-standard in function and method signatures for modern Perl code.
Buddy - have their been any performance comparisons for MS vs. other modules providing similar if less comprehensive functionality eg. Method::Signatures::Simple.
Not that I'm aware of, although it's a very good suggestion. I know that both schwern and I did some benchmarking of MS vs MXMS: schwern's results are available in a gist, but I never published mine (I used them in a Perl Mongers talk; I just never converted that talk to a useful online format).
But something more along the lines of a comparison of MS vs MSS vs Function::Parameters, etc would probably be very useful. I'll have to look into doing that.
I'll chime in and say that Method::Signatures has made writing perl much, much nicer! I use the named parameter support all the time. Thanks for the work you put into it maintaining the module.