[squeak-dev] The Inbox: PackageInfo-Base-jr.74.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jun 3 21:55:01 UTC 2020

A new version of PackageInfo-Base was added to project The Inbox:

==================== Summary ====================

Name: PackageInfo-Base-jr.74
Author: jr
Time: 3 June 2020, 11:55:02.712983 pm
UUID: 5c85662d-24db-244b-84fe-756d449c63c9
Ancestors: PackageInfo-Base-jr.73

Find extension methods on the metaclasses. Avoid iterating over all subclasses of ProtoObject.

If we want to know what is in a package in a particular environment, then it should not also gather all the classes from other environments. This could be particularly nasty if you have two environments with different versions of the same package, which means there are classes with equal names. Not only did it pick up classes that don't belong in the package in the current environment, it also found extension methods on classes not imported in the current environment (that is: the extensions of the package with the same name in the other environment).

As a side effect, this should be faster if you have a considerable amount of classes in other environments in your image. For example, a duplicated partial hierarchy of the base classes, but not with an own copy of ProtoObject...

Still, environments and extension methods remain a difficult combination if you do share classes between environments.

=============== Diff against PackageInfo-Base-jr.73 ===============

Item was added:
+ ----- Method: Environment>>allReachableClassesAndTraitsDo: (in category '*PackageInfo-Base') -----
+ allReachableClassesAndTraitsDo: aBlock
+ 	bindings valuesDo:
+ 		[:each |
+ 		each isBehavior ifTrue:
+ 			[aBlock value: each]]!

Item was changed:
  ----- Method: PackageInfo>>allOverriddenMethodsDo: (in category 'enumerating') -----
  allOverriddenMethodsDo: aBlock
  	"Evaluates aBlock with all the overridden methods in the system"
+ 	^ Environment current allReachableClassesAndTraitsDo: [:class | 
- 	^ ProtoObject withAllSubclassesDo: [:class | 
  		self overriddenMethodsInClass: class do: aBlock]

Item was changed:
  ----- Method: PackageInfo>>externalClasses (in category 'dependencies') -----
+ 	| myClasses environment |
- 	| myClasses |
  	myClasses := self classesAndMetaClasses.
+ 	environment := Environment current.
  	^ Array streamContents:
  		[:s |
+ 		environment allReachableClassesAndTraitsDo:
- 		ProtoObject withAllSubclassesDo:
  			[:class |
+ 			(myClasses includes: class)
+ 				ifFalse: [s nextPut: class theNonMetaClass;
+ 						nextPut: class theMetaClass]]]!
- 			(myClasses includes: class) ifFalse: [s nextPut: class]]]!

More information about the Squeak-dev mailing list