A first integration of Roel Typer in Squeak

Lukas Renggli renggli at gmail.com
Thu Sep 29 21:52:18 UTC 2005


> <ArrayedCollection Bag Heap Interval LinkedList MappedCollection
> OrderedCollection Set SkipList WeakRegistry>
>
> It's a little bit surprising that there's no common superclass of all
> of these that it could have found.  Of course, that seems to place
> too much weight on inheritance - it almost makes me want to define
> some kind of first class abstract protocol (trait?) that captures
> what all of those have in common, so the type inferencer could just
> list that...

findLeastGeneralClass: aCollection
	| remainingClasses currentClass |
	remainingClasses := aCollection asOrderedCollection.
	currentClass := remainingClasses removeFirst.
	[ remainingClasses isEmpty ] whileFalse: [
		[ remainingClasses first includesBehavior: currentClass ] whileFalse: [
			currentClass := currentClass superclass ].
		remainingClasses removeFirst ].
	^currentClass

--
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list