Stories
Slash Boxes
Comments
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 ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Sunday October 02, 2005
10:15 PM

Anyone using Sub::Signatures?

[ #26971 ]

I strongly suspect the number of people using Sub::Signatures hovers around zero, give or take none. Given this "fact" and the warnings posted in the documentation, I feel reasonably comfortable contemplating a backwards-incompatible API change. Essentially, I want to remove all type checking of arguments. Dispatching on argument type was fundamentally flawed both in my implementation and in my failure to appreciate allomorphic interfaces (in other words, if I pass an object that can do something I want, I don't care about its class).

If you've not heard of it, this module does this:

use Sub::Signatures;

sub foo($bar) {
    print "$bar\n";
}

sub foo($bar, $baz) {
    print "$bar, $baz\n";
}

foo(1);     # prints 1
foo(2,3);   # prints 2, 3
foo(2,3,4); # fatal error (at runtime)

With my contemplated change, that's all it would be able to do: method and subroutine dispatch based on the number of arguments (possibly with an optional "fallback" method).

Note: yes, it's a source filter and yes, I've heard the arguments. This post is merely to ask if anyone uses this module, not to debate its merits.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.