Overview
Artifact ID: | 2b193da2209cc91d8fdde089b897a60415bcd537604f22e8be8f8ceaf1813018 |
---|---|
Ticket: | effa2e2346f8372ad4982d16bad189fab96ceb56
RFE - lazy loading of TclOO for faster interp creation |
User & Date: | sebres 2025-08-16 13:06:20 |
Changes
- icomment:
Nice thing. As for objections or rather theoretical breakage, I think the way you did it is one of the best under these circumstances (without having namespace-based lazy-load facility). For instance one can rewrite `package require tcl::oo` to force initialisation, so could help for some theoretical case it is really needed (for example like below). And the possible breakage may be theoretic endless loop in TclOOInitModuleObjCmd, if some command gets injected, mocked-up etc, e. g. by something like this (<b style="color:red">red</b> is lazy branch): <code><pre> % rename ::oo::class ::oo::_mocked_class; % proc ::oo::class args { puts "mockup $args"; tailcall ::oo::_mocked_class {*}$args } % ::oo::class create A mockup create A <b style="color:red">- too many nested evaluations (infinite loop?)</b> <b style="color:green">+ ::A</b> </pre></code> As for improvements, I'd later provide my attempt. <blockquote><i>> Looking for an extension that uses it ...</i></blockquote> I think, Itcl would be good candidate (v4.x is based on tclOO).
- login: "sebres"
- mimetype: "text/x-fossil-wiki"