Changing the superspace of a namespace

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing the superspace of a namespace

ZuLuuuuuu
Hello,

I was toying with some reflection features. When I try to change a superspace of a namespace by using #superspace: message I usually get a "doesNotUnderstand: #recompileAll" error. For example the code below:

Smalltalk addSubspace: #MySpace.
MySpace superspace: Kernel.

gives an error like this:

Object: DisabledPackage error: did not understand #recompileAll
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
Kernel.DisabledPackage class(Object)>>doesNotUnderstand: #recompileAll (SysExcept.st:1407)
optimized [] in AbstractNamespace>>superspace: (AbstNamespc.st:410)
[] in Dictionary>>do: (Dictionary.st:357)
Dictionary(HashedCollection)>>do: (HashedColl.st:201)
Dictionary>>do: (Dictionary.st:357)
Namespace>>do: (Namespace.st:168)
Namespace(AbstractNamespace)>>superspace: (AbstNamespc.st:411)
UndefinedObject>>executeStatements (Temp/deneme (copy).st:2)

Is this a bug or should I do this in another way?
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: Changing the superspace of a namespace

MrGwen
On 07/29/2011 12:44 AM, ZuLuuuuuu wrote:

> Hello,
>
> I was toying with some reflection features. When I try to change a
> superspace of a namespace by using #superspace: message I usually get a
> "doesNotUnderstand: #recompileAll" error. For example the code below:
>
> Smalltalk addSubspace: #MySpace.
> MySpace superspace: Kernel.
>
>
> gives an error like this:
>
> Object: DisabledPackage error: did not understand #recompileAll
> MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
> Kernel.DisabledPackage class(Object)>>doesNotUnderstand: #recompileAll
> (SysExcept.st:1407)
> optimized [] in AbstractNamespace>>superspace: (AbstNamespc.st:410)
> [] in Dictionary>>do: (Dictionary.st:357)
> Dictionary(HashedCollection)>>do: (HashedColl.st:201)
> Dictionary>>do: (Dictionary.st:357)
> Namespace>>do: (Namespace.st:168)
> Namespace(AbstractNamespace)>>superspace: (AbstNamespc.st:411)
> UndefinedObject>>executeStatements (Temp/deneme (copy).st:2)
>
>
> Is this a bug or should I do this in another way?
>
> -----
> Canol Gökel
> --
> View this message in context: http://forum.world.st/Changing-the-superspace-of-a-namespace-tp3702742p3702742.html
> Sent from the Gnu mailing list archive at Nabble.com.
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-smalltalk

Seems to work with:

diff --git a/kernel/AbstNamespc.st b/kernel/AbstNamespc.st
index 44d44db..9b1fd7b 100644
--- a/kernel/AbstNamespc.st
+++ b/kernel/AbstNamespc.st
@@ -406,14 +406,14 @@ an instance of me; it is called their
`environment''. '>
                 [:each |
                 each isClass
                     ifTrue:
-                       [each recompileAll.
-                       each class recompileAll]].
+                       [each compileAll.
+                       each class compileAll]].
         self allSubassociationsDo:
                 [:assoc |
                 assoc value isClass
                     ifTrue:
-                       [assoc value recompileAll.
-                       assoc value class recompileAll]]
+                       [assoc value compileAll.
+                       assoc value class compileAll]]
      ]

      subspaces [

Cheers,
Gwen

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Changing the superspace of a namespace

Paolo Bonzini-2
On 07/29/2011 10:38 AM, Gwenael Casaccio wrote:

>
>
> diff --git a/kernel/AbstNamespc.st b/kernel/AbstNamespc.st
> index 44d44db..9b1fd7b 100644
> --- a/kernel/AbstNamespc.st
> +++ b/kernel/AbstNamespc.st
> @@ -406,14 +406,14 @@ an instance of me; it is called their
> `environment''. '>
>                  [:each |
>                  each isClass
>                      ifTrue:
> -                       [each recompileAll.
> -                       each class recompileAll]].
> +                       [each compileAll.
> +                       each class compileAll]].
>          self allSubassociationsDo:
>                  [:assoc |
>                  assoc value isClass
>                      ifTrue:
> -                       [assoc value recompileAll.
> -                       assoc value class recompileAll]]
> +                       [assoc value compileAll.
> +                       assoc value class compileAll]]
>       ]
>
>       subspaces [

Applying this, thanks.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk