http://pastebin.com/yrLu9j7W
- Code ("At the top of"): Select all
var dum = {} ;
var menubar = {};
var sidebar = {};
var plot = {};
And then he has an _App::create() function, which is doing this:
http://pastebin.com/yrLu9j7W
- Code ("_App::create() (line 540+)"): Select all
plot["canvas"] = Box.new();
plot["canvas"].create(dlg,grphB, me.sbwidth,me.mbheight,me.pwidth,me.pheight);
plot["xline"] = Xline.new();
plot["xline"].start(grph,me.sbwidth,me.pwidth,me.pheight,me.height);
plot["line"] = _plot.new();
print ( "type plot[0] : "~typeof(plot[0]));
So he does use hashes for a reason, even though it's a single shared hash for all instances of _App currently, it's only the debug/typeof() expression that treats it like a vector.
@Philosopher: What's happening here under the hood, i.e. semantics-wise: 1) we have a hash like var dum = {} and 2) someone assigns something to it by using the vector-syntax, using a number as the hash key i.e. dum[0] - which would be like dum.0 (invalid), so is it mapped to dum["0"] transparently ??