[Laszlo-dev] __LZlastmtrix, what is it doing on LzView.prototype?

P T Withington ptw at pobox.com
Wed Jan 2 13:32:03 PST 2008


Things on the prototype are instance variables, no class variables.

Possibly the writer was concerned that a new array would be consed for  
each instance, but currently that is _not_ the semantics of AS3/JS2.   
If you just change this to:

   var __LZlastmtrix = [ 0,0,0,0,0,0,0,0,0,0,0 ];

then every instance will share the same initial value.  There is no  
way (yet) in JS2/AS3 to declare the array as immutable [i.e., no  
equivalent of C++ (*const), or is it (const*)?  I never can remember.]

On 2008-01-02, at 12:24 EST, Henry Minsky wrote:

> In LaszloView.lzs, there's a declaration
>
> LzView.prototype.__LZlastmtrix = [ 0,0,0,0,0,0,0,0,0,0,0 ];
>
>
> This is declaring a class variable right? Is there any reason we
> cannot  just change that to "static var ..." now?
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list