--- Allison Randal <[EMAIL PROTECTED]> wrote: > I'm still not convinced of your basic point, that it would be a good > thing to have C<when> aliasing $_. Variations on whether it does it > automatically or at my request and how don't change the fundamental > concept. C<when> is a conditional like C<if>, not a topicalizer.
Right, it's a topicalizee, the victim of topicalization. And so it uses $_ or $x or $! or whatever the current topic is. But inside, you have to KNOW what the topic is again, you can't just use the default variable(s), so that differentiation of for @logged_exceptions -> $e { when .survivable { if $e.isa('Exception::PEBKAC') { ... } } } versus CATCH { when .survivable { if $!.isa('Exception::PEBKAC') { ... } } } becomes necessary. What I'm trying to suggest is that C<when>, because it already is doing some special things (huge list of conditionals to try, implied 'next'), is an orthogonal code element. It really IS going sideways, and unless you are coding sideways (using C<given> or C<CATCH>) the when-block represents a context-switch at the developer level. To that end C<when> should, when (urg!) used in a loop or other straight-ahead construct to check the current topic, force the current topic to become the default. =Austin __________________________________________________ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com