« Return to Thread: [squeak-dev] Namespaces, Packages: Image available for download, screencast.

Re: [squeak-dev] Namespaces, Packages: Image available for download, screencast.

by Igor Stasenko :: Rate this Message:

Reply to Author | View in Thread

Cool screencast Michael! :)

I have played with it few minutes to look how it doing things.

One thing, which i don't like is how looks a class declaration:

self inNamespace: 'Kernel.Classes'
        createClass: 'ClassCommentReader'
        ofType: 'normal'
        superclass: 'ClassCategoryReader'
        instanceVariableNames: ''
        classVariableNames: ''

to what 'self' refers to?

Do you plan to allow creating classes by subclassing existing ones,
e.g. by sending a messages to them, like in regular smalltalk?

To my understanding, the above should look like:

Kernel.Classes addClass: (
   Kernel.Classes.ClassCategoryReader subclass: #ClassCommentReader
   type: 'normal'
   instanceVariableNames: ''
   classVariableNames: ''
).

This indicates two separate concepts involved here: namespaces
(Kernel.Classes) and subclassing by sending message to existing class.
And #addClass: here is just a convenience method, which can look like:

Namespace>> addClass: aClassObject
   ^ self addSymbol: aClassObject name value: aClassObject
"or, more smalltalk-ish"
  ^ self at: aClassObject name put: aClassObject

 « Return to Thread: [squeak-dev] Namespaces, Packages: Image available for download, screencast.

LightInTheBox - Buy quality products at wholesale price!