in reply to Re: RFC: Inline::Blocks or inline as a keyword?
in thread RFC: Inline::Blocks or inline as a keyword?
> I'm the author of Type::Tiny which internally does a lot of inlining. I mean, seriously a lot.
May I ask how you solved this?
> This is because Perl is able to optimize the do case to the plain case.
Are you sure?
DB<17> sub test { print do { 5+4 } } DB<18> print B::Deparse->new("-p")->coderef2text(\&test) { use feature 'current_sub', 'say' ... # yadda shortened print(do { # still here 9 }); }
this is the mentioned do-case
{ use warnings; use strict; my($total); foreach $_ (1 .. $end) { ($total += do { (1 / $_) }); } $total; }
DB<27> print $] 5.024001
hence the do-opcode is still present.
I suppose you meant to say that it has no performance penalty.(?)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC: Inline::Blocks or inline as a keyword?
by tobyink (Canon) on Sep 09, 2018 at 20:04 UTC | |
by LanX (Saint) on Sep 09, 2018 at 21:34 UTC | |
by tobyink (Canon) on Sep 18, 2018 at 08:23 UTC |