Forum OpenACS Q&A: Response to Why is ad_parameter deprecated?

Posted by Michael A. Cleverly on
don: i was planning on announcing this but was waiting because i want to rename one of the procs, parameter::set_value, to parameter::set, but i can't yet because there is a bug in the aolserver namespace code that does not let me do that.

i submitted a patch to the aolserver folks but they have not applied it yet.

Whoa... hang on. I imagine that rather than a bug in AOLserver's namespace code, the bug is in the "redefinition" of the Tcl command set, at least within the scope of code executing in the parameter namespace.

When code runs inside the scope of a namespace commands (which are not themselves qualified with a namespace) are searched for in the current namespace, and, if nothing is found, in the global scope.

So if you define a namespace::set proc, then you need to explicity qualify all instances of set in your code (that runs in the same namespace) to use the global set, i.e. ::set.