I would like to get rid of all those implicit scopes.  The only
exception would be that any topicalizing modifier allocates a private
lexical $_ scoped to just that statement.  But dynamic scoping may
happen only at explicit block boundaries.

I can see the argument for the other side, where any "deferred"
code is treated as a kind of closure regardless of whether there are
explicit curlies around it.  That would solve certain problems like
defining the scopes of the lexicals in

    $a = $x ?? my $y :: my $z;

or the infamous

    my $x = 1 if $y;

to extend only to the subexpressions in which they find themselves.
But it's not what naive users expect, and it's hard to explain, so I
think we should stick with explicit curlies for most of our scoping
needs, even if it means letting certain variables hang around undefined
because their initialization was never executed.


Reply via email to