By normal operator I mean that it could work on non-constant objects too.
And to change the resolver to return objects flagged as constant-index-optimize as long as only modules or submodules are indexed.
Then you could do things like
| #ifdef DYNAMIC_LOAD | class dynload( string module ) | { | object real; | mixed `->(string x) { | if( !real ) real = master()->resolv( module ); | return predef::`->(real,x); | } | } | object Protocols = dynload("Protocols"); // Dynamically loads Protocol | // module on demand. | #endif | | void get_url( ) | { | Protocols.HTTP.get_url_nice( ... ); // <-- equivalent to HTTP->get_url_nice | } |
and have minimal codechanges to implement dynamic loading (nothing has to change in the code using the Protocol.whatever modules, only change needed is the existance of the class-global Protocols object).
pike-devel@lists.lysator.liu.se