the new decade has just begun and I'm facing a hash/class problem which I can not solve on my own:
For example, I create a class with several sub hashes "first", "second" and "third":
- Code: Select all
var Cfoo_class =
{ new: func()
{ var m = { parents: [Cfoo_class] };
return m;
},
first:
{ one: func()
{ .... # do whatever one has to do ...
},
foo_one: func()
{ .... # even more stuff ...
},
},
second:
{ two: func()
{ .... # do whatever two has to do ...
},
foo_two: func()
{ .... # even more stuff ...
},
},
third:
{ three: func()
{ me.first.one(); # DOES NOT WORK !!! Error message: "No such member "first"
parents[0].first.one(); # DOES NOT WORK !!! Error message: "Undefined symbol "parents"
me.parents[0].first.one(); # DOES NOT WORK !!! Error message: "No such member "parents"
},
},
};
When I try to access a method/function that is located in a different sub hash, Nasal complains about member cannot be found.
What do I have to do to call functions from a different sub hash?
Regards,
Autowings