Finding the package from the method category

Stéphane Ducasse stephane.ducasse at univ-savoie.fr
Tue Aug 22 20:56:37 UTC 2006


I would like to know the package from a method category.
Especially since it does not seem possible to uniquely identify that :(

I tested and if I have two packages

	Foo
	Foo-Test

	and methods
	in Zork
		*Foo
		*Foo-testing
		*Foo-Test

Foo will contain all the methods and Foo-Test on the Foo-Test ones.

So there is no one one mapping between method categories and  
packages. :(

packageName
	"to be moved in packageInfo"
	
	^ self category first = $*
		ifTrue: [ (PackageInfo named: (self category allButFirst)) name  
asSymbol]
		ifFalse: [self methodClass instanceSide category asSymbol ]

testCompiledMethodPackage
	"self debug: #testCompiledMethodPackage"

	self assert: (CompiledMethod>>#packageName) packageName = #'MSE- 
Exporter'.
	self assert: (CompiledMethod>>#hasLiteral:) packageName = #'Kernel- 
Methods'.
	self assert: (Point>>#x) packageName =  #'Graphics-Primitives'.
	self assert: (Point class>>#x:y:) packageName =  #'Graphics- 
Primitives'.

but fails for my example.
does anybody have an idea.

Stef 



More information about the Squeak-dev mailing list