:
> Basically I just meant another syntax for:
> swf["width"] = 100
> so you could use instead:
> swf.width = 100
> I never dreamt of real objects derived from classes with
inheritance
> and all.
You can do plain structures like the above with
local swf_struct=class.define("swf","","height width")
swf = swf_struct.new
sfw.width = 100
This can appear in any file. You can even make the swf_struct global
and re-use it (or you could have a function that returned swf
structs). It actually will could fail for obscure reasons if you
define it in a file which happens to have a function called new in
it; its easy to provide a workaround for that which I will do in next
beta.
However, it seems like you will always need two statements: one to
define the template for the structure, and one to create a structure
isntance.
> > Just some quick questions/remarks:
> - methods/functions are always public, right?
> (private functions might be useful...)
Not sure what you mean here. If you mean methods which cannot be
seen outside of the file which defines a class, even if you have an
instance of that class, I will think about it. But its a little
tricky as really all this stuff if just re-using standard functions.
> - static vars in the class are used by all instances, right? So
when
> one instance changes the var, the other instance sees the changed
> var?
>
Static variables, yes. Statics can be treated as standard OO class
variables as long as you define only one class per file (which is all
you can do now, but this might change). Of course, each object
instance has its own copy of the its variables as listed in the
class.define (and any base classes).