develooper Front page | perl.perl6.language | Postings from September 2001

what lexicals do?

Thread Next
From:
Dave Mitchell
Date:
September 6, 2001 09:39
Subject:
what lexicals do?
Message ID:
200109061638.RAA13043@gizmo.fdgroup.co.uk
Here's a list of what any Perl 6 implementation of lexicals must be able to
cope with (barring additions from future apocalyses). Can anyone think of 
anything else?

From Perl 5:

* multiple instances of the same variable name within different scopes
	of the same sub

* The notion of introduction - a variable that has been defined but does
	not yet	mask an outer var, eg  my $x = 1; { my $x = $x+1; ... }

* an inner sub referring to a lexical in a lexically enclosing outer sub
	- ie closures.

* eval - ie delayed compilation of an inner sub with restored scope

* typed lexicals

* our


New in Perl 6:

* %MY:: dynmaically changing the values and visibility of lexicals

* lexically scoped named subs - so caller(){MY::}{'&die'} = &mydie does
	something useful.



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