dnmfarrell / Sub-Attributes

Meta programming with subroutine attributes
https://metacpan.org/pod/Sub::Attributes
Other
1 stars 1 forks source link

Add a test for Function::Parameters #3

Open opendevnet opened 8 years ago

opendevnet commented 8 years ago

It doesn't break anything, and it's always nice when things work with Function::Parameters :-)

Inspired by Schwern and other responses to this Stack Overflow query:

dnmfarrell commented 8 years ago

Thanks for this. Perl has subroutine signatures built in from version 5.20 upwards. What if we changed this to a conditional test that used native signatures and only ran if the Perl version was high enough?

cpansprout commented 8 years ago

I think the point is to make sure there is no incompatibility between Function::Parameter’s own prototype handling and Sub::Attributes. When perl’s built-in subroutine signatures are used, perl’s own prototype handling code still continues to be used, so those code paths are already tested elsewhere. But Function::Parameters has to _re_implement what perl already does, because of the way it is written. So testing with Function::Parameters makes sense, but the test should be skipped if Function::Parameters is installed.

(Does anything I wrote make any sense?)

opendevnet commented 8 years ago

or, even better: the test should be skipped if Function::Parameters is not installed. :-)

cpansprout commented 8 years ago

Er, yeah, that’s what I meant. :-)

dnmfarrell commented 8 years ago

There are a lot of signatures modules. My favorite was Method::Signatures, for example. Why would we include a compatibility test for this particular signatures modules in Subroutine::Attributes?