It's been a while since I did any cmods, but now I need to write one for work related stuff. All questions are in the context of late CVS 7.7.
Q1: How should I define my classes to get the following function:
indices(Foo);
({ get_bar })
object x = Foo(); indices(x);
({ get_bar })
get_bar();
Foo.bar();
Ie, I want a class within Foo that can only be instantiated using the Foo.get_bar() method.
Q2: Is there a way that a Foo.bar() object (as described above) can access the variables defined in Foo? (The variables which are accessed thru the THIS-pointer that is.)
References to where things like this is already done within the Pike-source is appreciated.