develooper Front page | perl.perl6.language | Postings from April 2002

Re: Exegesis 4

Thread Previous | Thread Next
From:
Damian Conway
Date:
April 3, 2002 18:14
Subject:
Re: Exegesis 4
Message ID:
3CABB706.467108B8@conway.org
Larry wrote:
> 
> siracusa@mindspring.com writes:
> : On 4/3/02 6:44 PM, Damian Conway wrote:
> : > Larry has said very clearly that in Perl 6 there are no "magical" lexical
> : > scopes.
> :
> : Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only
> : one 'magical' lexical scope: sub() or ->"
> 
> It's specifically exempted because it's declaring formal parameters.
> You have to be able to declare formal parameters outside the actual
> scope or you can't have separate declarations and definitions.

And this is the same in just about every reasonable language.

Another way of thinking about it is to say: A C<my> variable is always
scoped to the block in which it's declared.

(Parameters are then exempt because they have no C<my>).

Damian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About