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

[Xotcl] Classes and namespace

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Tue, 30 Jan 2001 00:54:05 +0200 (EET)

[~] package require XOTcl
0.83
[~] namespace eval Foo {
>Class MyClass
>MyClass instproc init {} {
>AnotherClass newChild
>}
>Class AnotherClass
>}
AnotherClass
[~] Foo::MyClass new
invalid command name "AnotherClass"
while evaluating {Foo::MyClass new}

Ie. it appears as if methods aren't run in the same namespace as
where classes exist (or a child namespace of this). I know this isn't
exactly a bug (as I don't think it's specified anywhere?), but I believe
the natural behaviour would be for AnotherClass to be found in the example
above, as it's specified within the same namespace as Foo.

Is the any chance the current behaviour could be altered to one that I
think is more intuitive? Or is there a good reason why not?


         - ---------- = = ---------//--+
         | / Kristoffer Lawson | www.fishpool.fi|.com
         +-> | setok_at_fishpool.com | - - --+------
             |-- Fishpool Creations Ltd - / |
             +-------- = - - - = --------- /~setok/