[Pharo-dev] Old ClassBuilder remove!

Stephan Eggermont stephan at stack.nl
Fri Nov 22 05:56:34 EST 2013


kilon wrote:
>any links why newcomers like me should be impressed ? Whats the advantages ? 

Then we can now have more compact versions of 

FreeTypeSettings LabelMorph MorphTreeNodeMorph MorphTreeListManager ThemeSettings MultistateButtonMorph PharoUserPermissions SimpleHierarchicalListMorph Nautilus class SpecTreeColumn PluggableIconListMorph MorphTreeMorph Workspace CompositionScanner Paragraph MethodOveridesAction HandMorph TextComposer ScrollBar NECContext MultiByteFileStream NewValueHolder DynamicClassGroup SearchMorph NautilusHistoryEntry PluggableTextFieldMorph PluggableListMorph TableLayoutProperties DynamicGroup DropListMorph GradientFillStyle PackageTreeNautilus PluggableTextMorphWithLimits NECUntypedModel BalloonEngine MetacelloPharo30Platform SystemWindow NautilusWindow NECPreferences class EditorFindReplaceDialogWindow GoBackStringMorph NautilusHistoryEntryWithSourceCode MCCacheRepository PluggableButtonMorph AlphaImageMorph PluggableTextMorph RxMatcher MorphExtension TextMorphForFieldView MorphTreeColumn FindReplaceService CheckboxMorph TextMorphForEditView IndentingListItemMorph ControlButtonMorph CheckboxButtonMorph

with multiple booleans mapped to one instVar

set := IdentitySet new.
Object allSubclasses do: [ :aClass |
	|varSize coll nr candidate |
	candidate := false.
	varSize := aClass instSize.
	coll := aClass allInstances.
	nr := 10 min: coll size.
	(coll first: nr) do: [ :anInstance |
		|value nrBoolean| 
		nrBoolean := 0.
		1 to: varSize do: [ :varIndex |
			value := anInstance instVarAt: varIndex.
			value class = True ifTrue: [ nrBoolean := nrBoolean + 1  ].
			value class = False ifTrue: [ nrBoolean := nrBoolean + 1  ]].
		nrBoolean >1 ifTrue: [ candidate := true ]   ].
	candidate ifTrue: [ set add: aClass ]].

More information about the Pharo-dev mailing list