Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

  (email not shown publicly)
AOL IM: MichaelSchwern (Add Buddy, Send Message)

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Tuesday October 28, 2008
03:33 AM

Method::Signatures, now with 581% more debugger!

[ #37755 ]

I'm happy to announce that with the latest release of Method::Signatures the last major bugs have been fixed. This is through no fault of my own, but Florian and Rhesa's latest work on Devel::Declare.

Method::Signatures now works with the debugger. This was the big one keeping it from any hope of being taken seriously for production use. Apparently Florian found some "this should never have worked" code in Devel::Declare that was causing the problem.

The debugger sees what's in the source file, not the generated code, which is good. But it has to step through each of the hidden statements, which is not so good. Suggestions on what to do about that welcome.

The other issue is now method declarations happen at compile-time, just like regular subroutines. This is thanks to a fresh Devel::BeginLift patch. While not a big deal for production, it was one of those "I have no idea how to fix this" problems.

All the really terrifying guts which were formally cut & pasted & hacked from a Devel::Declare test file have now been packed back into Devel::Declare and maintained by Rhesa. This lets all the fledgling signature modules share their fixes and lets others experiment.

[If it hasn't hit CPAN yet, get it from github]

There's one major technical issue left. Data::Alias, which provides the fast guts for "is alias" and "\@foo", doesn't work on Windows before 5.10. Unless that's fixed Method::Signatures is going to be a troublesome dependency for Windows users. One option is if Data::Alias doesn't work to fall back to Data::Bind, which does work but its a lot slower. I already do that with Readonly::XS, its an optional dependency because it has a silly test bug in 5.10.

So, let me know if anyone is crazy enough to be using this in production. And please keep sending test patches (or just fork it on github and send me a pull request), especially for signatures that shouldn't work but don't throw a sensible error.

PS If Method::Signatures interests you, but you want something a little simpler and with less dependencies, try Method::Signatures::Simple. Same backend as Method::Signatures, but only Devel::Declare as a dependency.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Awesome. Thanks for the work.
  • Latest version of Devel::Declare that works on 5.8.8 on Windows is 0.002000, so current issue is Devel::Declare, not Data::Alias.

    P.S. Data::Alias will work on 5.8.9/Win32.
  • Shouldn't it be called Method::Signatures::Lite?
    • I guess that depends on how you define "Lite" and "Simple" which are pretty ambiguous. The fad now-days seems to be towards "Simple" which usually means "simpler interface, but less features".

      It's not as ambitious as Method::Signatures, and it's missing a lot of features. This greatly simplifies the code, since it doesn't have to do any fancy parsing of the prototype. It makes it much more predictable as to what the result will be, and can reach stability faster (pending Devel::Declare stability). It ju