Re: BeanShell 1.3 Scoping Changes (Revised)

Pat <[email protected]>
Newsgroups gmane.comp.java.beanshell.devel,gmane.comp.java.beanshell.user
Message-ID <[email protected]>
On Wed, Jun 25, 2003 at 05:40:27PM -0500, Pat wrote:
> 
> 	flag = false;
> 
> 	setFlag() {
> 		flag = true;
> 		localVar = true;
> 	}
> 
> 	setFlag();
> 	print( flag ); // true
>   print( localVar ); // ERROR! undefined here

After some re-consideration I believe we should keep local declaration of 
untyped variables for BeanShell 1.3.   That is, as shown above, if a variable 
is not declared or assigned a value in an enclosing scope it will be assigned
locally, in the scope in which it is used.

I agree with the developers who commented that it feels better and that it's 
not that onerous for new users to have to be told to do something like the 
above to make their untyped variables visible in a the parent scope.  

I think the change we have made strikes a good balance and looks fairly 
natural to eyes used to Java.  With the 1.3 scoping changes it is no longer 
necessary to use the non-standard 'super.' or 'global.' qualifiers in normal
scripts.

I am revising the user manual now and we should have a 1.3 beta release
very soon.  Thanks for your input.


Thanks,
Pat



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.