date: 2019/06/08 14:53:23
- user: cg
- file: ClassOrganizer.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
- Claus Gittinger
in contrast to other smalltalks, ST/X does not keep the
method <-> category associations in the class (as organization),
but instead keeps the category as an instance variable of methods.
For compatibility with (fileOut-) files which include a class organization
message, 'aClass organization' returns an instance of this class, which
implements the category change functionality.
Also, some PD code seems to use & define methods for ClassOrganizers
- having this (somewhat dummy) class around helps to fileIn that code.
Notice, that instances of ClassOrganizer are NOT used in the current ST/X
system; all of this is pure compatibility mimicri.
This is an additional goody class; therefore:
THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
create & return a new instance of myself, to organize aClass
( an extension from the stx:libcompat package )
change & update
Number organization addCategory:'foo'.
addCategory: aCategory before: symbolOrNil
return a collection of my classes method-categorySymbols
SmallInteger organization categories
return the category for the method specified by aSelectorSymbol.
Return nil, if there is no such method.
Number organization categoryOfElement:#foo.
Object organization categoryOfElement:#==
return the classes comment
Number organization classComment
return a collection of my classes selectors
SmallInteger organization elements
return a collection of selectors whose methods are categorized
SmallInteger organization listAtCategoryNamed:#arithmetic
remove a categories assignments - dummy here
update: something with: parameter from: changedObject
(comment from inherited method)
dependent is notified of some change -
Default is to try update:with:
printing & storing
take category<->selector associations from aString, and change
the categories of those methods.
Only required when filing in ST-80 code, which changes the categorization
changeFromString:'( ''category1'' #foo1 #foo2 foo3)
( ''category2'' #bar1 #bar2)'
classify: aSelector under: aCategory
change the category of the method stored under aSelector
Number organization printString
set the class