A Variety of Squeak-ish Questions

Bijan Parsia bparsia at email.unc.edu
Wed Jan 21 19:05:30 UTC 1998


At 1:26 PM -0500 1/21/98, Mark Guzdial wrote:

>I've been saving up a list of general Squeak questions, and when adding one
>today, I decided to ask them all at once:
>
>- What's the easiest way of moving a method from one protocol to another,
>or a class from one category to another?  For the former, I've been
>cutting-pasting code, but I can't figure out how to do the latter.

The easiest way (I think) to move methods from protocal to protocal is the
"reorganize" menu command associated with the protocal list in the
browsers. Just copy and paste the method names into the desired protocal
array.

>From the class #Magnitude

	('comparing' < <= = > >= between:and: hash hashMappedBy:)
	('testing' max: min: min:max:)

To move hash from comparing to testing, accept

	('comparing' < <= = > >= between:and: hashMappedBy:)
	('testing' max: min: min:max: hash)


As for changing the category of a class, all you need to do is edit the
definition. For example, to move (for no good reason) the class #magnitude
from the category "Numeric-Magnitudes" to "Numeric-Numbers" select the
class (or the class list menu item 'definition'):

	Object subclass: #Magnitude
		instanceVariableNames: ''
		classVariableNames: ''
		poolDictionaries: ''
		category: 'Numeric-Magnitudes'

Then edit the category and accept the change:

	Object subclass: #Magnitude
		instanceVariableNames: ''
		classVariableNames: ''
		poolDictionaries: ''
		category: 'Numeric-Numbers'

It's just like adding a variable!

Cheers,
Bijan Parsia

(Mark, I'm ccing a copy to you since my posts to the list don't seem to be
showing up. If you get two copies could you let me know?)





More information about the Squeak-dev mailing list