Re: errors and their keywords and where catch can return toand stuff like that
[email protected] (Chaim Frenkel) 14 Aug 2000 21:59:16 -0400
| Newsgroups | perl.perl6.language.flow |
|---|---|
| Message-ID | <[email protected]> |
I think folks are forgetting that there are more than one client for any class. Global settings should be restricted to a single setter. The only logical single setter is main. All other clients should be using something local. Another reason to avoid globals, is we are designing perl6 to be thread friendly. Adding globals (this includes read-mostly access) adds overhead, cost and yet another variable that increases deadlock potential. Just say no to globals (as much as possible) <chaim> >>>>> "PS" == Peter Scott <[email protected]> writes: PS> Everyone seems to have started thinking about the implication of PS> inheritance in exception classes at the same time. Whatever the default PS> behavior is, we can easily change it on a global basis (using Chaim PS> Frenkel's sub name here); PS> sub Exception::uncaught_handler { maybe rethrow, maybe not } PS> Or a per-class basis: PS> sub Exception::IO::uncaught_handler { ... } PS> Or a per-object basis (gross as I find this): PS> my $e = Exception::SQL->new(...); PS> $e->uncaught_handler = sub { ... } PS> throw $e; # or maybe throw Exception::SQL(uncaught_handler => sub { ... PS> }, ... ); PS> And the dispatcher would look first in the object, then in the class for PS> uncaught_handler. PS> I think it's cool how this process is converging :-) -- Chaim Frenkel Nonlinear Knowledge, Inc. [email protected] +1-718-236-0183