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

Re: [perl #123092] Sub inlining inconsistencies

Thread Previous | Thread Next
From:
demerphq
Date:
November 3, 2014 07:10
Subject:
Re: [perl #123092] Sub inlining inconsistencies
Message ID:
CANgJU+XX5Ob928dvWb=KNMTbFqu45ON0pAL1bKnnFWTY98QbLg@mail.gmail.com
On 2 November 2014 15:16, Father Chrysostomos via RT <
perlbug-followup@perl.org> wrote:

> On Sun Nov 02 00:30:58 2014, demerphq wrote:
> > IOW, I think you are trying to solve this problem the wrong way. Don't
> > bother fixing it, make it unnecessary to do at all.
>
> Also, there are cases where a sub containing two variables is mistakenly
> deemed eligible for inlining, and then the wrong variable is used (or perl
> crashes).  I think those cases should definitely be fixed.  But I don’t
> know where to draw the line between ‘definitely’ and fixes that you don’t
> deem necessary.
>

Fixing this so it doesnt "blow up" is IMO fine.

All I am saying is that it seems like you are working with a real edge case
here in that (I believe that) not that many people make functions with no
arguments, in comparison to people who make constants. If fixing the edge
case means breaking existing code making constants then IMO it is not worth
it.

Which then says to me the right solution is to provide some other prototype
which can solve the problem of creating argumentless subs without
triggering the const behavior.

And if you do that then you might as well also make a ":const"
prototype/attribute whatever. Which then would leave the () prototype as
"broken by design, do not use it if you want well defined behavior", and at
the point you dont have to fix it at all.

Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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