Preprocessor design issue
- Posted by Humberto <codehead78 at YAHOO.COM> Apr 09, 2001
- 511 views
I hit a snag in the design of my preprocessor. I can't decide what to do in this situation: sequence a a = repeat(new foo(), 3) a[3].method_such_and_such(45) This would require all classes have their class type stored internally and their methods called via call_func(id). I don't want to do this, I had planned on keeping all class information out of the data structures so that classes are just sequences with NO overhead. I would like to do the following: a = repeat(new foo(), 3) a[3].foo:method_such_and_such(45) foo b = new foo() b.method_such_and_such(45) --Don't need to specify a class This way, the preprocessor could use the appropriate method without extra code to call it. Is this a good solution? Can other problems come up by not storing the class type in the sequence? Thanks for any feedback, -Humberto