Hi,

I think it is not documented, and it's usually strange that people write
code dependent on this order. However, to anwer your questions, you can
look at MCPackageLoader>>#basicLoadDefinitions. More specific below:

On Tue, Jan 24, 2017 at 3:07 PM, webwarrior <r...@webwarrior.ws> wrote:

> It is not documented.
>
> What happens when I load a package?
> Are all classes created first, and then methods are added, or classes are
> loaded one-by-one with all their methods?
>

- new classes added
- new (versions of) methods are compiled
- old classes and methods removed

- retry definitions that were erroneous

- install all new methods
- notifications
- postloads


> What about Slots? Are they added to classes after all classes are loaded?


No, they are added to the class when it is created


> Do
> they have their methods by that time?
>

It depends. If the class was not loaded before, it does not have methods.
If the class existed and you're loading a different version, it'll have the
old methods.


> What is order of loading of classes? Alphabetical, or using some resolution
> mechanism, or is it implementation detail?
>

It looks by looking at the code that they are sorted by dependency between
them (for example, superclasses before subclasses).
But I did not look much further.


>
> What happens when I unload the package? Is it inverse of loading so order
> is
> reversed?
>

Apparently, (look at MCPackageLoader class>>#unloadPackage:) the order is
reversed by dependency (first methods, then subclasses, then superclasses)


Guille

Reply via email to