Re: [Beanshell-users] RE: Announce: Upcoming BeanShell 1.3 Scoping Changes...
Pat <[email protected]>
| Newsgroups | gmane.comp.java.beanshell.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jun 26, 2003 at 05:31:26AM +0900, Daniel Leuck wrote: > > In BeanShell 1.3 the assignments > > now follow the "strict Java" style of applying wherever the > > variable was defined, or ultimately in the global scope if > > not defined at all. > > I think the first part is great, the second part, as Shankar pointed out, is problematic. > > I really think making auto-declared variables global will cause massive pollution of the namespace, introduce bizarre and hard to track bugs, and cause beanshell to be unsuitable for large scripts. But the first change (looking for a previously defined variable in the parent scope first) would make the language equally unsuitable for large scripts unless people changed their habits to scope their local variables... because any new variable added in the global scope would change the meaning of that variable name everywhere in the script... that was my foremost worry initially. To use the new style of scoping people would have to change their habits and make their local variables local by either declaring them with var or prefixing them (at least the first time) with 'this.'. Again, I don't like this either, but it seems like the healthiest thing to do at this point... Still open to suggestions. 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