develooper Front page | perl.perl5.porters | Postings from June 2013

Re: Removing do SUBROUTINE(LIST) (was: What does "deprecated" mean?)

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
June 29, 2013 14:18
Subject:
Re: Removing do SUBROUTINE(LIST) (was: What does "deprecated" mean?)
Message ID:
CAHhgV8gL1pyrXqEp_+KPS5WmDcXEimWac3wkxK9FMq_8Bk7Meg@mail.gmail.com
On Fri, Jun 28, 2013 at 12:48 AM, Dagfinn Ilmari Mannsåker
<ilmari@ilmari.org> wrote:
> It's 43 out of 1444 lines in perly.y, so just a hair under 3%.
>
> It doesn't have any runtime effect, it compiles to a bog standard
> ENTERSUB op (with the OPf_SPECIAL flag set, which is only used by
> B::Deparse to output the "do" correctly).
>
> It's entirely self-contained in the grammar
> (http://perl5.git.perl.org/perl.git/blob/HEAD:/perly.y#l1110 et seq), so
> the only reason to touch it would be if you're changing how ENTERSUB ops
> are built in general.
>
> Out of curiosity, I went and ripped it (and related tests) out. The
> diffstat, excluding generated files, is:
>
>  perly.c              |  3 --
>  perly.y              | 43 -----------------------------
>  pod/perlfunc.pod     |  6 ----
>  t/lib/warnings/perly | 30 --------------------
>  t/op/do.t            | 66 ++------------------------------------------
>  t/op/lexsub.t        | 31 +--------------------
>  6 files changed, 3 insertions(+), 176 deletions(-)
>
> And a regen_perly.pl run adds:
>
>  perly.act |  304 ++++++-------
>  perly.h   |    2 +-
>  perly.tab | 1229 +++++++++++++++++++++++++----------------------------
>  3 files changed, 704 insertions(+), 831 deletions(-)
>
> The results are at https://github.com/ilmari/perl/tree/remove-do-sub if
> anyone is interesed.

I like it :-)

Leon

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