[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtcl-user
Subject:    [vtcl-user] Namespace question
From:       randy () viragelogic ! com (Randy Reichenbach)
Date:       2000-05-16 17:25:35
[Download RAW message or body]

Hi All,

I have a problem with tcl8.2 namespaces.  Consider the following foo example:

File foo.tcl:

package provide foopkg 1.0
proc xyz {} {
}
namespace eval foo {
    proc bar {} {
    }
}


Now from my main code I require foopkg.  I can easily call foo::bar if I first
call a non-namespace proc like xyz.  However if I try to call foo::bar without
first calling a non-namespace proc, Tcl tells me 'invalid command name
"foo:bar"'

Nothing within a namespace makes it into my pkgIndex.tcl.  Is there a method
for getting the auto_loader to know about namespace procs without having to
call another non-namespace proc first?

I realize that I should have avoided namespaces altogether and used itcl for
encapsulation, but hey, I didn't, and thousands of code lines later, I'm
regrettin' it!

Thanks for any suggestions!


--
Randy Reichenbach - Software Engineer
Virage Logic - Bellevue WA

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic