On Thursday 13 March 2003 22:21, you wrote:
> Does Tcl's rename command work in AOLserver 4.0?  With 3.3+AD13, if I
> add "rename cmd cmd_old" to a file in modules/tcl, it seems to work.
> But the same code doesn't appear to be working on 4.0 beta 3.  Any ideas?
> Thanks!

It has to do with the way Tcl interp is initialized.
In pre-4 times, blueprint of the interpreter was
obtained in a different way. This included low-level
copy of all Tcl_CmdInfo structures from the
startup interp to the connection interp. Obviously,
if you renamed the command, you only changed its name
but the cmd structure remained and it was copied to
the new interp.

Well, I was not very fond of this solution...

The 4.x series do not fiddle with the cmd structures
on the Tcl level. Instead, 4.x tries its best to
replicate C-level commands by re-loading modules
(i.e. calling their registered cmd traces) during
the interp creation. This, of course, defeats any
renamed commands but is *way* better in terms of
supporting arbitrary Tcl extensions.

You may now obviously ask: how do we achieve the
functionality with the 4.x?

At the moment, I can only think of:

  append cmd [ns_ictl get] {
     rename cmd cmd_old
  }
  ns_ictl save $cmd

This will append your rename commands to the
blueprint script and this script will be used
to initialize all new interps.

You might want to get yourself familiar with
the ns_ictl command. You may find this cmd
very interesting and valuable.


HTH, Zoran



I. To remove yourself from this list:

Send a message to "[EMAIL PROTECTED]"  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/

Reply via email to