Nathan Wiger said: > > What lexical scope should $x be _implicitly_ declared in? Maybe, just > > maybe, we need a my $x at the top to tell us it is outside the scope of the > > first reference. Otherwise we get three different lexical variables, and an > > undefined value warning at run time. > ... > For example, one solution might be that the default lexical scope is > only delimited on function boundaries: > ... This doesn't fix the problem of: { $somevar = 0; $someVar++; # oops, wrong case! } Forcing 'my' by default allows these errors to be caught. I'd like to see perl 6 encourage 'clean code' out-of-the-box. Then, People Who Know What They're Doing can choose to turn on shortcuts as necessary, but Mere Mortals are encouraged to create mantainable and readable programs. In this case, 'use strict "vars"' becomes the default behaviour, and a new 'use implicitdeclare "functionlevel"' provides the Lazy behaviour.
- Re: lexical variables made default Tom Christiansen
- Re: lexical variables made default Graham Barr
- RFC: lexical variables made default (revised) J. David Blackstone
- Re: RFC: lexical variables made default (revised) John Tobey
- Re: RFC: lexical variables made default (revi... J. David Blackstone
- Re: RFC: lexical variables made default (revised) Tom Christiansen
- Re: RFC: lexical variables made default (revi... J. David Blackstone
- Re: RFC: lexical variables made default (revised) Nathan Wiger
- Re: RFC: lexical variables made default (revi... Glenn Linderman
- Re: RFC: lexical variables made default (... Nathan Wiger
- Re: RFC: lexical variables made defau... Jeremy Howard
- Re: RFC: lexical variables made ... Tom Christiansen
- Re: RFC: lexical variables m... Jeremy Howard
- Re: RFC: lexical variables made default (revi... Nathan Torkington
- Re: RFC: lexical variables made default (... Nathan Wiger
- Re: RFC: lexical variables made defau... Ariel Scolnicov
- Re: RFC: lexical variables made default (... Damian Conway
- Re: RFC: lexical variables made defau... Nathan Wiger
- Re: RFC: lexical variables made ... Johan Vromans
- Re: RFC: lexical variables m... Nathan Wiger
- Re: RFC: lexical variables m... Tom Christiansen