develooper Front page | perl.perl5.porters | Postings from June 2008

Re: design questions

Thread Previous | Thread Next
June 2, 2008 08:58
Re: design questions
Message ID:
On Mon, Jun 02, 2008 at 05:40:10PM +0200, Roland Giersig wrote:
> G'day Bruce,
> I'm wondering, would it be feasible to retrofit Fatal so it also can 
> work locally? This would mean to rename/alias autodie to Fatal and add 
> some backward-compatibility sugar.
> If you
>  use Fatal;
> in global scope, it should have global scope. But if you
>  sub a_local_scope_and {
>    use Fatal;
>    ...
>  }
> it could detect that it is used inside a local scope and thus act 
> locally, giving a warning on the side telling that we broke 
> backward-compatibility.

What's the point of changing the meaning of something, and then,
when someone uses the new meaning, give a warning the meaning was
changed? Who's going to benefit from that? Certainly not existing code
as the meaning will change. And new code will not use it, as we're all
Pavlovved to not use code that issues warnings - that will us get shunted
from the community. So, about the only people who'd benefit are the ones
that don't use warnings. 

> Wouldn't the warning be a good thing generally? If Fatal is used in 
> non-global scope, emit a warning that it should be moved to global 
> scope. Or is this too much nagging?

I'd say so. How often do you see people posting code where they used Fatal
inside a block, wrongly assuming it would not raise a fatal error outside
of the block?


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