Re: Rationale for $!
[email protected] (Felipe Gasper) Wed, 27 Jan 2016 10:32:46 -0500
| Newsgroups | perl.perl6.language |
|---|---|
| Message-ID | <[email protected]> |
On 27 Jan 2016 10:15 AM, Moritz Lenz wrote:
>
> On 01/27/2016 03:15 PM, Felipe Gasper wrote:
>> So, what *is* the scoping of $!?
>
> Scoped to a routine, iirc (sub, method, regex)
Interesting. JavaScript programmers that I’ve known bemoan that their
language uses function scoping rather than block scoping.
That also seems incongruent with the built-in block scoping for try/CATCH.
Has Perl 6 embraced function scoping as a major paradigm, then?
But, what is the point of $! at all? The exception is given to the CATCH
block as $_. If I want access to it outside CATCH, isn’t the expected
workflow to save CATCH{$_} to a variable, the way my example does it?
$! is also not mentioned here: http://perl6intro.com/#_exception_handling
-FG