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

Re: RFC: core sub signature introspection

Thread Previous | Thread Next
From:
Abigail
Date:
November 24, 2016 10:17
Subject:
Re: RFC: core sub signature introspection
Message ID:
20161124102118.GA22990@almanda.fritz.box
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.



Abigail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About