NS` how can I get programmatic reference to a particular category?

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

NS` how can I get programmatic reference to a particular category?

Robert Withers
I must define variableByte subclasses in the category. Categories are
not part of the namespace nor or symbols looked for there. SO I need
programmatic access. I didn't find anything in the documentation, as it
is an implementation issue. Could someone knowledgeable point out how I
can do this?

ty,
Robert




smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NS` how can I get programmatic reference to a particular category?

Hans-Martin Mosner
Am 25.09.2015 um 18:12 schrieb robert:
I must define variableByte subclasses in the category. Categories are not part of the namespace nor or symbols looked for there. SO I need programmatic access. I didn't find anything in the documentation, as it is an implementation issue. Could someone knowledgeable point out how I can do this?

ty,
Robert




    
It is somewhat unclear what you want to achieve.
Categories are simple strings, and "Smalltalk organization" (a SystemOrganizer) keeps the association between classes and categories.
To create a class in a given category, just execute the class creation expression with the proper category, something like this:

| nameOfYourClass nameOfYourCategory |
nameOfYourClass := #MyNewClass.
nameOfYourCategory := 'MyOldCategory'.
Object variableByteSubclass: nameOfYourClass
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: nameOfYourCategory

Cheers,
Hans-Martin


Reply | Threaded
Open this post in threaded view
|

Re: NS` how can I get programmatic reference to a particular category?

Robert Withers
Thanks for trying to help, Hans-Martin. It is a Newspeak thing: back in last years image one needs a reference to the category object to send lookup messages to.  This is changed now and I query the "platform squeak" namespace, which I got working last night.

Regards,
Robert

On 9/26/2015 3:26 AM, Hans-Martin Mosner wrote:
Am 25.09.2015 um 18:12 schrieb robert:
I must define variableByte subclasses in the category. Categories are not part of the namespace nor or symbols looked for there. SO I need programmatic access. I didn't find anything in the documentation, as it is an implementation issue. Could someone knowledgeable point out how I can do this?

ty,
Robert



It is somewhat unclear what you want to achieve.
Categories are simple strings, and "Smalltalk organization" (a SystemOrganizer) keeps the association between classes and categories.
To create a class in a given category, just execute the class creation expression with the proper category, something like this:

| nameOfYourClass nameOfYourCategory |
nameOfYourClass := #MyNewClass.
nameOfYourCategory := 'MyOldCategory'.
Object variableByteSubclass: nameOfYourClass
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: nameOfYourCategory

Cheers,
Hans-Martin



    




smime.p7s (4K) Download Attachment