Version 4 of Runtime creation of procs

Updated 2004-05-06 10:53:50

During March 2003, Glenn Jackman, Don Porter, Donald Arseneau, Arjen Markus and possibly others were discussing procs creating procs during runtime.

One of the issues discussed was that of scope - if a proc creates a proc, without anything fancy being done, in what namespace is the runtime created proc?

Here's an example provided by Ulrich Schoebel:

 % proc foo {} {proc bar {} {puts baz_1}}
 % namespace eval mymy {proc foo {} {proc bar {} {puts baz_2}}}
 % foo
 % ::mymy::foo
 % bar
 baz_1
 % ::mymy::bar
 baz_2
 %

which appears to demonstrate dgp's assertion that procs with non-fully-qualified names are created in the current namespace, whatever that happens to be.


 xonecubed -
 I created some functions to generate a taged list for the body of a proc.
 Check out [manipulating proc tags].