Hi, Was wondering why it's not possible to import namespaces when XOTcl objects are involved. The shortest example that I could rustle up is included below. Help in understanding what prevents this from working is much appreciated. -shishir
% package require XOTcl 1.4.0
% namespace eval ::my::test { namespace import ::xotcl::*
Class Foo
Foo instproc bar {} { puts " foo bar is a very tasty!" } }
% ::my::test::Foo foo ::foo % foo bar foo bar is a very tasty!
% ::my::test::Foo info instances ::foo
% # Why doesn't the following work? % namespace import ::my::test::*
% Foo foo2 invalid command name "Foo"
% ::my::test::Foo info instances ::foo
% Foo info instances invalid command name "Foo"
On 29 Oct 2006, at 03:54, Shishir Ramam wrote:
Hi, Was wondering why it's not possible to import namespaces when XOTcl objects are involved. The shortest example that I could rustle up is included below. Help in understanding what prevents this from working is much appreciated.
I didn't test your example, but could it be because you did not export 'Foo' from the namespace?
Ie. "namespace export Foo" could possibly help.
Kristoffer, Thanks that was it! -shishir
On 10/29/06, Kristoffer Lawson setok@fishpool.com wrote:
On 29 Oct 2006, at 03:54, Shishir Ramam wrote:
Hi, Was wondering why it's not possible to import namespaces when XOTcl objects are involved. The shortest example that I could rustle up is included below. Help in understanding what prevents this from working is much appreciated.
I didn't test your example, but could it be because you did not export 'Foo' from the namespace?
Ie. "namespace export Foo" could possibly help.
/ http://www.fishpool.com/~setok/