[comp.lang.smalltalk] Smalltalk Inhertance and Subtyping

cook@hplabsz.HPL.HP.COM (William Cook) (11/10/90)

Enclosed is the Postscript source for a diagram of
some data produced by the InterfaceHierarchy program.
It includes both the "interface" (subtype) hiearchy and
the familiar class implementation (inheritance) hierarchy.

There are several cases where the syntactic similarity of
selectors does not correspond to a true semantic relationship.
For example, Dictionary add: does not satisfy "adds a new
value and keeps everythings else the same" because adding
a new association (x,y) causes the removal of all other
associations (x,z).  Similarly with remove on Sets and Bags.

-william cook

ps: I am leaving HP as of today to go do product development
at Apple.  My new address will probably be "william@applelink.apple.com"
but this is not certain yet.

Below is the postscipt source of the hierarchies diagram:
------------------------------ cut here ----------------------------
%!
%%Title: final.fig
%%Creator: f2ps
%%CreationDate: Fri Oct 19 14:21:34 1990
%%Pages: 1
%%BoundingBox: 49 74 562 717
%%EndComments
/$F2psDict 32 dict def $F2psDict begin $F2psDict /mtrx matrix put
 end /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def
%%EndProlog
$F2psBegin
22.500000 717.000000 translate 0.900 -0.900 scale
1.000 setlinewidth
newpath 578.634 105.261 moveto 584.000 99.000 lineto 582.211 107.050 lineto stroke
	[4.000000] 0 setdash
newpath 567.333 90.667 18.634 169.696 26.564 arcn
 stroke
	[] 0 setdash
newpath 82.442 297.161 moveto 85.000 305.000 lineto 79.054 299.287 lineto stroke
	[4.000000] 0 setdash
newpath 220.489 219.980 159.955 -169.926 147.892 arcn
 stroke
	[] 0 setdash
newpath 56.088 385.804 moveto 57.000 394.000 lineto 52.338 387.198 lineto stroke
	[4.000000] 0 setdash
newpath 329.668 292.666 290.889 -104.466 159.613 arcn
 stroke
	[] 0 setdash
newpath 473.357 286.096 moveto 481.000 283.000 lineto 475.713 289.328 lineto stroke
	[4.000000] 0 setdash
newpath 264.516 -14.001 367.525 115.033 53.912 arcn
 stroke
	[] 0 setdash
newpath 336.809 406.949 moveto 345.000 406.000 lineto 338.219 410.692 lineto stroke
	[4.000000] 0 setdash
newpath 377.607 492.553 92.491 -154.682 -110.643 arc
 stroke
	[] 0 setdash
newpath 520.041 488.841 moveto 528.000 491.000 lineto 519.962 492.840 lineto stroke
	[4.000000] 0 setdash
newpath 530.235 379.002 112.020 144.533 91.143 arcn
 stroke
	[] 0 setdash
newpath 491.692 643.626 moveto 488.000 651.000 lineto 487.787 642.757 lineto stroke
	[4.000000] 0 setdash
newpath 250.083 598.004 243.748 -50.842 12.558 arc
 stroke
	[] 0 setdash
newpath 261.003 654.647 moveto 254.000 659.000 lineto 258.131 651.863 lineto stroke
	[4.000000] 0 setdash
newpath 146.500 554.833 149.689 -17.830 44.098 arc
 stroke
	[] 0 setdash
newpath 346.629 651.764 moveto 353.000 657.000 lineto 344.915 655.378 lineto stroke
	[4.000000] 0 setdash
newpath 395.780 566.830 99.804 178.754 115.381 arcn
 stroke
	[] 0 setdash
newpath 132.994 701.215 moveto 129.000 694.000 lineto 135.919 698.487 lineto stroke
	[4.000000] 0 setdash
newpath 173.500 652.500 60.848 43.002 136.998 arc
 stroke
	[] 0 setdash
newpath 238.708 481.149 moveto 246.000 485.000 lineto 237.754 485.034 lineto stroke
	[4.000000] 0 setdash
newpath 305.242 243.864 248.307 -159.277 103.803 arcn
 stroke
	[] 0 setdash
newpath 523.617 232.327 moveto 531.000 236.000 lineto 522.757 236.233 lineto stroke
	[4.000000] 0 setdash
newpath 603.274 -92.291 336.152 159.214 102.416 arcn
 stroke
	[] 0 setdash
newpath 286.379 396.988 moveto 282.000 390.000 lineto 289.152 394.105 lineto stroke
	[4.000000] 0 setdash
newpath 243.143 430.391 56.047 67.047 -46.109 arcn
 stroke
	[] 0 setdash
/fn0.8 /Times-Roman findfont 8.888889 scalefont def
fn0.8 setfont
(atAllPut:) 409 375 moveto 1 -1 scale show 1 -1 scale
(atAll:put:) 409 385 moveto 1 -1 scale show 1 -1 scale
(replaceFrom:to:-) 409 395 moveto 1 -1 scale show 1 -1 scale
(with:[startingAt:]) 414 405 moveto 1 -1 scale show 1 -1 scale
(after:) 118 586 moveto 1 -1 scale show 1 -1 scale
(before:) 113 596 moveto 1 -1 scale show 1 -1 scale
(removeAtIndex:) 81 606 moveto 1 -1 scale show 1 -1 scale
(removeAllSuchThat:) 66 616 moveto 1 -1 scale show 1 -1 scale
(copyEmpty) 99 626 moveto 1 -1 scale show 1 -1 scale
(mappedBy) 199 280 moveto 1 -1 scale show 1 -1 scale
(with:do:) 199 270 moveto 1 -1 scale show 1 -1 scale
(reverseDo:) 199 260 moveto 1 -1 scale show 1 -1 scale
(reverse) 199 250 moveto 1 -1 scale show 1 -1 scale
(copyWith:) 199 240 moveto 1 -1 scale show 1 -1 scale
(copyWithout:) 199 230 moveto 1 -1 scale show 1 -1 scale
(copyFrom:to:) 199 220 moveto 1 -1 scale show 1 -1 scale
(, \(concatenate\)) 199 210 moveto 1 -1 scale show 1 -1 scale
(ReadStream) 199 200 moveto 1 -1 scale show 1 -1 scale
(WriteStream) 199 190 moveto 1 -1 scale show 1 -1 scale
(startingAt:[ifAbsent:]) 184 180 moveto 1 -1 scale show 1 -1 scale
(indexOfSubCollection:-) 179 170 moveto 1 -1 scale show 1 -1 scale
(indexOf:[ifAbsent:]) 199 160 moveto 1 -1 scale show 1 -1 scale
(findLast:) 224 150 moveto 1 -1 scale show 1 -1 scale
(findFirst:) 224 140 moveto 1 -1 scale show 1 -1 scale
(last) 199 150 moveto 1 -1 scale show 1 -1 scale
(first) 199 140 moveto 1 -1 scale show 1 -1 scale
(asArray) 199 290 moveto 1 -1 scale show 1 -1 scale
(copyReplaceAll:with:) 234 316 moveto 1 -1 scale show 1 -1 scale
(copyReplaceFrom:-) 234 326 moveto 1 -1 scale show 1 -1 scale
(to:with:) 268 336 moveto 1 -1 scale show 1 -1 scale
(removeAll:) 112 310 moveto 1 -1 scale show 1 -1 scale
(remove:[ifAbsent:]) 112 300 moveto 1 -1 scale show 1 -1 scale
(add:beforeIndex:) 260 713 moveto 1 -1 scale show 1 -1 scale
(addAllLast:) 260 703 moveto 1 -1 scale show 1 -1 scale
(addAllFirst:) 260 693 moveto 1 -1 scale show 1 -1 scale
(add:before:) 260 683 moveto 1 -1 scale show 1 -1 scale
(add:after:) 260 673 moveto 1 -1 scale show 1 -1 scale
(addLast:) 427 515 moveto 1 -1 scale show 1 -1 scale
(addFirst:) 427 505 moveto 1 -1 scale show 1 -1 scale
(asSortedCollection) 449 38 moveto 1 -1 scale show 1 -1 scale
(asOrderedCollection) 449 28 moveto 1 -1 scale show 1 -1 scale
(asBag) 449 18 moveto 1 -1 scale show 1 -1 scale
(asSet) 449 8 moveto 1 -1 scale show 1 -1 scale
(inject:into:) 394 58 moveto 1 -1 scale show 1 -1 scale
(detect:[ifNone:]) 394 48 moveto 1 -1 scale show 1 -1 scale
(reject:) 394 38 moveto 1 -1 scale show 1 -1 scale
(collect:) 394 28 moveto 1 -1 scale show 1 -1 scale
(select:) 394 18 moveto 1 -1 scale show 1 -1 scale
(do:) 394 8 moveto 1 -1 scale show 1 -1 scale
(occurrencesOf:) 329 38 moveto 1 -1 scale show 1 -1 scale
(includes:) 329 28 moveto 1 -1 scale show 1 -1 scale
(size) 329 18 moveto 1 -1 scale show 1 -1 scale
(isEmpty) 329 8 moveto 1 -1 scale show 1 -1 scale
(addAll:) 241 110 moveto 1 -1 scale show 1 -1 scale
(add:) 241 100 moveto 1 -1 scale show 1 -1 scale
(at:) 401 110 moveto 1 -1 scale show 1 -1 scale
(at:put:) 495 190 moveto 1 -1 scale show 1 -1 scale
(keysDo:) 503 392 moveto 1 -1 scale show 1 -1 scale
(removeKey:[ifAbsent:]) 503 382 moveto 1 -1 scale show 1 -1 scale
(includesKey:) 503 372 moveto 1 -1 scale show 1 -1 scale
(keyAtValue:[ifAbsent:]) 503 362 moveto 1 -1 scale show 1 -1 scale
(keys) 503 352 moveto 1 -1 scale show 1 -1 scale
(associationsDo:) 503 342 moveto 1 -1 scale show 1 -1 scale
(removeAssociation:[ifAbsent:]) 503 332 moveto 1 -1 scale show 1 -1 scale
(includesAssociation:) 503 322 moveto 1 -1 scale show 1 -1 scale
(associationAt:[ifAbsent:]) 503 312 moveto 1 -1 scale show 1 -1 scale
(associations) 503 302 moveto 1 -1 scale show 1 -1 scale
(at:ifAbsent:) 503 292 moveto 1 -1 scale show 1 -1 scale
(<    <=    >=    >) 541 507 moveto 1 -1 scale show 1 -1 scale
(sameAs:) 501 507 moveto 1 -1 scale show 1 -1 scale
(match:[ignoreCase:]) 501 517 moveto 1 -1 scale show 1 -1 scale
(findString:startingAt:[ifAbsent:]) 501 527 moveto 1 -1 scale show 1 -1 scale
(copyUpTo:) 501 537 moveto 1 -1 scale show 1 -1 scale
(replaceFrom:to:withBytes:) 501 547 moveto 1 -1 scale show 1 -1 scale
(asNumber) 501 557 moveto 1 -1 scale show 1 -1 scale
(asFileName) 501 567 moveto 1 -1 scale show 1 -1 scale
(asUppercase) 501 577 moveto 1 -1 scale show 1 -1 scale
(asLowercase) 501 587 moveto 1 -1 scale show 1 -1 scale
(sortBlock:) 70 708 moveto 1 -1 scale show 1 -1 scale
(sortBlock) 70 698 moveto 1 -1 scale show 1 -1 scale
(removeFirst) 116 504 moveto 1 -1 scale show 1 -1 scale
(removeLast) 116 514 moveto 1 -1 scale show 1 -1 scale
(add:withOccurrences) 29 423 moveto 1 -1 scale show 1 -1 scale
(sortedCounts) 29 433 moveto 1 -1 scale show 1 -1 scale
(sortedElements) 29 443 moveto 1 -1 scale show 1 -1 scale
(increment) 240 394 moveto 1 -1 scale show 1 -1 scale
/fn0.16 /Times-Roman findfont 17.777778 scalefont def
fn0.16 setfont
(Smalltalk) 35 27 moveto 1 -1 scale show 1 -1 scale
(Collection) 35 46 moveto 1 -1 scale show 1 -1 scale
/fn0.18 /Times-Roman findfont 20.000000 scalefont def
fn0.18 setfont
(Hierarchies) 35 65 moveto 1 -1 scale show 1 -1 scale
% Polyline
newpath 164 499 moveto 379 654 lineto stroke
% Polyline
newpath 99 319 moveto 289 479 lineto stroke
% Polyline
newpath 549 114 moveto 579 124 lineto stroke
% Polyline
newpath 289 19 moveto 207 81 lineto stroke
% Polyline
newpath 289 19 moveto 380 77 lineto stroke
% Polyline
newpath 379 104 moveto 464 164 lineto stroke
% Polyline
newpath 464 184 moveto 556 230 lineto stroke
% Polyline
newpath 464 184 moveto 504 264 lineto stroke
% Polyline
newpath 464 184 moveto 369 369 lineto stroke
% Polyline
newpath 379 104 moveto 269 179 lineto stroke
% Polyline
newpath 203 104 moveto 98 299 lineto stroke
% Polyline
newpath 374 414 moveto 289 479 lineto stroke
% Polyline
newpath 374 414 moveto 414 479 lineto stroke
% Polyline
newpath 374 414 moveto 547 481 lineto stroke
% Polyline
newpath 289 499 moveto 224 659 lineto stroke
% Polyline
newpath 289 499 moveto 379 654 lineto stroke
% Polyline
newpath 414 499 moveto 224 659 lineto stroke
% Polyline
newpath 414 499 moveto 379 654 lineto stroke
% Polyline
newpath 414 499 moveto 484 659 lineto stroke
% Polyline
newpath 164 604 moveto 224 659 lineto stroke
% Polyline
newpath 164 604 moveto 114 659 lineto stroke
% Polyline
newpath 164 499 moveto 164 584 lineto stroke
% Polyline
newpath 99 319 moveto 164 474 lineto stroke
% Polyline
newpath 99 319 moveto 69 394 lineto stroke
% Polyline
newpath 319 309 moveto 275 371 lineto stroke
% Polyline
newpath 319 309 moveto 369 369 lineto stroke
% Polyline
newpath 269 199 moveto 319 284 lineto stroke
% Polyline
newpath 269 199 moveto 164 474 lineto stroke
% Polyline
newpath 203 104 moveto 504 264 lineto stroke
% Polyline
newpath 464 89 moveto 584 89 lineto stroke
/fn0.12 /Times-Roman findfont 13.333333 scalefont def
fn0.12 setfont
(Interface) 499 124 moveto 1 -1 scale show 1 -1 scale
(Implementation) 464 109 moveto 1 -1 scale show 1 -1 scale
/fn1.12 /Times-Italic findfont 13.333333 scalefont def
fn1.12 setfont
(Inheritance) 504 84 moveto 1 -1 scale show 1 -1 scale
fn0.12 setfont
(Ordered) 208 674 moveto 1 -1 scale show 1 -1 scale
/fn0.11 /Times-Roman findfont 12.222222 scalefont def
fn0.11 setfont
(Collection) 204 688 moveto 1 -1 scale show 1 -1 scale
(Mapped) 538 241 moveto 1 -1 scale show 1 -1 scale
/fn1.11 /Times-Italic findfont 12.222222 scalefont def
fn1.11 setfont
(Adjustable) 141 598 moveto 1 -1 scale show 1 -1 scale
fn0.11 setfont
(LinkedList) 359 671 moveto 1 -1 scale show 1 -1 scale
(Collection) 89 688 moveto 1 -1 scale show 1 -1 scale
(Sorted) 94 676 moveto 1 -1 scale show 1 -1 scale
(Arrayed) 354 382 moveto 1 -1 scale show 1 -1 scale
fn1.11 setfont
(Indexed) 359 99 moveto 1 -1 scale show 1 -1 scale
(Updatable) 439 179 moveto 1 -1 scale show 1 -1 scale
fn0.11 setfont
(Collection) 540 254 moveto 1 -1 scale show 1 -1 scale
(Dictionary) 484 282 moveto 1 -1 scale show 1 -1 scale
(Bag) 59 409 moveto 1 -1 scale show 1 -1 scale
fn1.11 setfont
(Poppable) 144 491 moveto 1 -1 scale show 1 -1 scale
fn0.11 setfont
(String) 534 496 moveto 1 -1 scale show 1 -1 scale
fn1.11 setfont
(Pushable) 389 494 moveto 1 -1 scale show 1 -1 scale
fn0.11 setfont
(Collection) 354 396 moveto 1 -1 scale show 1 -1 scale
(Interval) 254 383 moveto 1 -1 scale show 1 -1 scale
fn1.11 setfont
(CopyReplace) 294 304 moveto 1 -1 scale show 1 -1 scale
(Ordered) 254 194 moveto 1 -1 scale show 1 -1 scale
fn0.11 setfont
(Set) 89 316 moveto 1 -1 scale show 1 -1 scale
fn1.11 setfont
(Extensible) 174 99 moveto 1 -1 scale show 1 -1 scale
fn0.11 setfont
(RunArray) 466 672 moveto 1 -1 scale show 1 -1 scale
(Sequenceable) 254 494 moveto 1 -1 scale show 1 -1 scale
(Collection) 264 14 moveto 1 -1 scale show 1 -1 scale
fn0.8 setfont
(William Cook, HP Labs) 505 712 moveto 1 -1 scale show 1 -1 scale
fn0.12 setfont
(& Array) 354 409 moveto 1 -1 scale show 1 -1 scale
showpage
$F2psEnd
------------------------------ cut here ----------------------------