Menu

#265 Namespace collision

4.0*
closed-fixed
None
5
2015-12-20
2015-10-25
No

Starting in Itcl 4.0, two objects with the same name cannot be created in two different namespaces:

package require Itcl

itcl::class Class {}

namespace eval A {Class c}
namespace eval B {Class c}

This fails with the error:
INTERNAL ERROR cannot set variable "::itcl::internal::variables::c::Class::this"

This is due to the object's fully qualified name not being used in the "::itcl::internal::variables" namespace.

Discussion

  • Don Porter

    Don Porter - 2015-11-30

    Will look at this along with the other variable troubles.

     
  • Don Porter

    Don Porter - 2015-12-07

    In the reported case, indeed, replacing simple names with
    fully qualified names could resolve the matter. Generally though,
    this is simply an unworkable scheme that must be replaced.

    % itcl::class ::b::c {}
    % itcl::class ::c {}
    % c ::a::b
    ::a::b
    % b::c ::a
    INTERNAL ERROR cannot set variable "::itcl::internal::variables::a::b::c::this"

    %

     
  • Don Porter

    Don Porter - 2015-12-20
    • status: open --> closed-fixed
    • assigned_to: Don Porter
     

Log in to post a comment.