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

Re: [perl #119811] Two DB::lsub oddities

From:
Zefram
Date:
November 23, 2017 00:20
Subject:
Re: [perl #119811] Two DB::lsub oddities
Message ID:
20171123001933.GB4913@fysh.org
Father Chrysostomos wrote:
>DB::sub has to exist for DB::lsub to be called.
...
>Why this limitation?

It might perhaps be in order to avoid making sub calls any more expensive
than they already are.  Some logic other than the actual DB::{,l}sub()
call is controlled by the existence of DB::sub(), and non-debugging calls
would get more expensive if DB::lsub() had to be checked for as well.
However, the extra expense would in the usual case be only a check of
the CvLVALUE flag.  Any opinion on whether that cost is worth incurring?

In the case of an lvalue sub there'd also be the extra cost of looking
up the *DB::lsub glob, which is currently done by name.  We'd probably
want to add a PL_DBlsub variable to provide direct access to the glob.

-zefram



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