develooper Front page | perl.perl5.porters | Postings from December 2019

Re: @_ Suppression

Zefram via perl5-porters
December 4, 2019 22:02
Re: @_ Suppression
Message ID:
Paul "LeoNerd" Evans wrote:
>look at (I believe) @DB::args though the exact logic confuses me. Will
>that remain working here?

Ooh, this turns out to be more interesting than it first seemed.
Obviously we'd want @DB::args to still be populated: it's still a
useful facility, and logically the concept of "the arguments with which
the subroutine was invoked" (as stated in the caller() doc) applies
just as well regardless of whether those arguments went into an @_.
But the implementation in pp_caller() is very tied up with @_, actually
referring to the AV that serves as the sub's @_.  (Some, but not all,
alterations to @_ affect what shows up in @DB::args.)  This wouldn't
work with @_ suppression.  It'll be necessary to implement a new way
for context stack frames to refer to a sub's arguments; probably just
pointing to them on the stack.

-zefram Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About