Re: Local / lazy referencing

Adam Megacz <[email protected]> 07 Oct 2003 13:54:47 -0700
Newsgroups gmane.comp.java.xwt.widgets
Organization XWT
Message-ID <[email protected]>
Charles Goodwin <[email protected]> writes:
> As I understand it, 'declare before use' stipulates that a variable must 
> be declared by 'var variable'.  You're saying that 'var variable's are 
> private to the script that decalres them.  So all variables are... 
> private?  Either there's some flawed logic going on, or public variables 
> no longer exist.

thisbox.foo = 5; // public
foo = 5;         // illegal
var foo = 5;     // private

> Perhaps the introduction of 'pub' in addition to 'var'?  Or, possibly 
> better, have a 'private' keyword - 'var private x' or 'private var x'.

That's actually a possibility.

> I don't know, I'm not sure how ECMA handles it,

Sadly, it simply doesn't.

  - a



-- 
"Education is not filling a bucket but lighting a fire." -- WB Yeats