develooper Front page | perl.perl5.porters | Postings from November 2016

Re: RFC: core sub signature introspection

Thread Previous | Thread Next
November 24, 2016 10:17
Re: RFC: core sub signature introspection
Message ID:
On Sun, Nov 13, 2016 at 02:52:49PM +0100, Aaron Crane wrote:
> I've just pushed a branch arc/smoke-me/signature-introspection,
> containing an initial implementation of introspection for core
> subroutine signatures.

If code gets to introspect a subroutine signature, it's no longer
the case that:

    sub some_sub ($foo, $bar, $baz) {

is just a programmer friendly way of writing

    sub some_sub {
        my ($foo, $bar, $baz) = @_;

it suddenly becomes more. It becomes part of the API. Changing the
name of a variable may break some code elsewhere. Variables which
should be lexical, aren't.

I really like subroutine signatures. But if that means that I'll have
to a deprecation cycle just because I want to rename a variable which
ought to be internal, I might as well not even start using signatures.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About