Inheriting unfinished programs
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=7703
Reported by Martin Karlgren marty@roxen.com
It's currently not possible to inherit programs that aren't finished yet. This means that you often need to do run-time indexing rather than compile-time ("Module["Submodule"]->function()" rather than "Module.Submodule.function()"). Also, proper variable typing is not always possible (you need to declare "object var" rather than "Module.Submodule.Type var").
From src/program.c:
if (!(p->flags & PROGRAM_FINISHED)) {
/* Require that the inherited program really is finished in pass
* 2. Otherwise we might not have all definitions when we
* fixate our program.
*
* FIXME: Maybe this can be relaxed by registering a dependency
* and delaying compilation here?
*/
yyerror ("Cannot inherit program in pass 2 "
"which is not fully compiled yet.");
yyerror ("(You probably have a cyclic symbol dependency that the "
"compiler cannot handle.)");
}
Is it plausible to do what the FIXME says to overcome this limitation? Time estimate?