Re: Local / lazy referencing

Charles Goodwin <[email protected]> Tue, 07 Oct 2003 10:28:49 +0100
Newsgroups gmane.comp.java.xwt.widgets
Organization XWT Foundation
Message-ID <[email protected]>
Adam Megacz wrote:
>>How is the public/private issue now handled?
> 
> Sadly, it is simply not handled ;)
> 
> var variables are private to the script that declares them, but we no
> longer have a way of declaring "package-private" stuff.  The new
> resource system makes this challenging.  Lemme know if you have any
> suggestions.

I don't quite get this.

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.

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

I don't know, I'm not sure how ECMA handles it, or whether I've 
completely misunderstood what you meant.

- Charlie