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

Re: design questions

Aristotle Pagaltzis
June 2, 2008 11:08
Re: design questions
Message ID:
Hi Roland,

* Roland Giersig <> [2008-06-02 17:45]:
> 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.

you’re reopening issues that have already been hashed out. Please
look up the old threads if the summary at the end of this mail
does not satisfy you, as we’ve been over this in some detail.

> If Fatal is used in non-global scope, emit a warning that it
> should be moved to global scope.

And you are sure it should be, how?

Perl lets people put their `use`s wherever they want and I make
use of that with some frequency.

The documentation of is also perfectly clear about how
it works.

So if I happen to put a `use Fatal` line in the middle of a
nested scope there is zero point in it telling me that I did so.

> Or you could
>  use Fatal::Locally;
> which would make all following scoped Fatals act locally.

Action at a distance does not a good way to design an API make.

> I'm not opposing the autodie name, please see these suggestions
> as an addition and as a trial to rectify the somewhat broken
> semantics of Fatal.

The legacy semantics of will need to be supported in the
future since it has been around for around a decade. Trying to
fix it means there will interactions between global and lexical
semantics, and the consensus of our previous discussion was that
the corner cases cannot be resolved in a non-confusing way.

Therefore, we agreed that it would be better to put new semantics
in a new interface that shall obsolete the old one.

Aristotle Pagaltzis // <> Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About