View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] Namespaces and Xotcl

From: Shishir Ramam <sramam_at_gmail.com>
Date: Sat, 28 Oct 2006 18:54:04 -0700

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"