I have a library to which I'm trying to create an interface. The library has a general part and several "submodules".
Ok.
I want to make the glue so that the user first creates an object Foo() from the program Foo. Then, from Foo(), the user may create other objects which uses the general parts as set up in Foo().
Therefore, the user must not do Foo.Bar() directly. She should only be able to do Foo()->Bar() or something similar such as Foo()->get_bar() to create Bar-objects.
You'll get this enforced by the runtime if Foo.Bar has been tagged as PROGRAM_USES_PARENT.
Did that clarify what I wish to do? Using the ID_STATIC flag on the Bar program still shows Bar when doing indices(Foo) but does not allow Foo()->Bar(). Is there a way of solving this?
I don't believe you. predef::indices() filters static symbols.
/ Henrik Grubbström (Lysator)
Previous text:
2004-08-13 13:45: Subject: CMOD questions
Ah, ok I'll do my homework then.. ;)
I don't think that I want an lfun::`()() that returns a Gazonk-object in Foo.Bar.
I think I'm explaining this wrong. Here is another attempt:
I have a library to which I'm trying to create an interface. The library has a general part and several "submodules".
I want to make the glue so that the user first creates an object Foo() from the program Foo. Then, from Foo(), the user may create other objects which uses the general parts as set up in Foo().
Therefore, the user must not do Foo.Bar() directly. She should only be able to do Foo()->Bar() or something similar such as Foo()->get_bar() to create Bar-objects.
Did that clarify what I wish to do? Using the ID_STATIC flag on the Bar program still shows Bar when doing indices(Foo) but does not allow Foo()->Bar(). Is there a way of solving this?
/ Marcus Agehall (PacketFront)