> > #catch { set fh [open init_interp_code.tcl w] ; puts $fh $init ;
> > close $fh }
> >
> > in namespace.tcl, proc _ns_getinit.
> > Somebody ever tried this?
>
> What do you mean?  What exactly are you trying to achieve?

Well, the line above, if uncommented, creates a (big) file which holds all
procs sourced in after startup.

looks like that (example):

namespace eval {} {
        variable tcl_version 8.3
        variable ...
        proc do_something {
                ...
        }
        (dozens, hundreds of procs)
        ...
}

The namespace.tcl routines create that set of sourced-in procs every time
_ns_getinit is called:
#       AOLserver will invoke this script in the
#       initial thread's interp at startup and
#       after an ns_eval to generate a script for
#       initializing new interps.


Is it a bad idea, maybe before use on the production system, to let AOLserver
create the file, byte compile the procs, adding "load libtbcload..." and
sourcing this file instead of running through the process every time?

> What do you mean?  What exactly are you trying to achieve?

Would that help speed up things?
Would it "hide" all procs from the info vars/procs/body... command to make it
(more) difficult to inspect vars, procs and environment at runtime?

Bernd.

Reply via email to