[squeak-dev] how to extend a class (add methods) and have the source of the methods be in a category other than the one the class is defined in?
Lou at Keystone-Software.com
Fri Jan 13 17:38:13 UTC 2017
Thanks for the prompt reply. I'm still a little confused. Allow me to describe what we do in
VA Smalltalk and see if we can get the same results in Squeak.
VA Smalltalk has a class called Application. Applications are similar (I think) to Class
categories (the first pane on the left). Classes can appear in more than one Application. Each
Application a class appears in holds some methods. A class starts out being defined in one
application. It is "extended" by adding methods to other applications. If one of those
applications is not loaded, then the extended methods are not available.
I have created a Class category to hold my program. As part of the program I want to add a few
methods to say the String class. But I'm afraid I will add them to the class category where
String is defined.
Does this make sense and how do I do it in Squeak?
On Fri, 13 Jan 2017 12:18:37 -0500, Bob Arning <arning315 at comcast.net> wrote:
>Class categories (the first pane on the left at the top of a system
>browser) are completely different from method categories (third pane
>from the left). Assuming you are talking about method categories, you can:
>- select the desired method category before you enter and save the method
>- if it's already in the wrong category...
>-- drag the method name from the fourth pane into the third pane at the
>-- copy the method source, select the desired category, paste the method
>source back in and save
>-- choose "reorganize" from the third pane menu
>On 1/13/17 11:55 AM, Louis LaBrunda wrote:
>> Hi All,
>> How does one extend a class (add methods) and have the source of the methods be in a category
>> other than the one the class is originally defined in? I expect this is simple and I'm just
>> missing something easy.
Keystone Software Corp.
More information about the Squeak-dev