develooper Front page | perl.perl5.porters | Postings from January 2022

Re: Broken stack traces from use statements.

Thread Previous | Thread Next
From:
Darren Duncan
Date:
January 16, 2022 08:08
Subject:
Re: Broken stack traces from use statements.
Message ID:
e55d95cb-2d40-83cd-d224-749d6a3260b5@darrenduncan.net
On 2022-01-15 11:10 p.m., Dan Book wrote:
> On Sun, Jan 16, 2022 at 1:54 AM demerphq wrote:
>     It seems to me we should be able to agree on whether the output is true, and
>     whether it is correct. I am really struggling to understand why this is
>     controversial. It seems to me we should be able to agree that main::BEGIN
>     *cannot* be called from anywhere but main, and this means that the output
>     claiming that the block was called from a module file cannot be correct.
> 
> No one is claiming it is the most useful thing to display to the user. Just that 
> it represents what the Perl interpreter sees, at least to some extent. The only 
> thing controversial is various declarations of what is correct and what must be 
> done, where a reasoned discussion and assumption of good faith would be much 
> more effective at motivating resolution of your issue.

Perhaps the best solution here is reporting the most comprehensive result that 
gives all of the information that either of the behaviors under discussion 
gives, but does so in a deterministic manner.

So include the information about BEGIN blocks but have the result structured in 
a way that makes it easy to filter that out if we don't want it.  So those who 
desire either the older or newer version of the output have all the info they 
need to derive it.

Alternately, while it may be considered a bit kludgy, maybe leave caller alone 
with the behavior it has had for decades and add a NEW complementary built-in 
that provides the other behavior, and then those that want the alternate "more 
correct" behavior can call the new one instead.

-- Darren Duncan

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