[BUG][TEST] ObjectsAsMethods don't understand perform:

Markus Gaelli gaelli at emergent.de
Thu Jan 8 20:14:30 UTC 2004


Hi folks,

I am playing around with ObjectsAsMethods from Andreas to do some fast 
MethodWrappers
with them, but when I wrap Monticello for example, I get a 
primitiveFailed error in perform:.

Andreas acknowledged the bug already. He believes that some checking 
for the right number
of parameters is only appropriate if the method at hand is a standard 
compiled method.
He just does not have time for that right now.

I believe he means

Interpreter >> primitivePerform and friends

the according line should be

	self success: ((self argumentCountOf: newMethod) = argumentCount).
	
But I neither know how to ask in a fast manner if a method is a 
compiled one, nor do I have
time to build several VMs. I tried the VM-Simulator yesterday and ran 
in the same problem as Stef.

Maybe somebody wants to try Neds VM-Simulator fixes from today and help 
to build one of the worlds
fastest method wrappers?

Here is the test:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestObjectsAsMethods.st
Type: application/text
Size: 1137 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040108/15398d2d/TestObjectsAsMethods.bin
-------------- next part --------------


Regards,

Markus

p.s. some totally unrelated fun script to produce some natural spirals, 
including the golden ratio (137.5),
should be "etoyed"...

backgroundColor:= Color blue muchDarker.
leafColor:=Color orange.
leafSize:= 15 at 15.
anExtent:=Display extent y at Display extent y.
aCanvas:= BalloonCanvas extent: anExtent.
numbersOfLeafs:=400.
[Display fillColor: backgroundColor.
0 to: 360 by: 0.5 do: [:anAngle |
(1 to: numbersOfLeafs) do: [:anInt |
	|aPoint|
	aPoint:= ((anInt sqrt * ((anInt * anAngle degreesToRadians) cos @ 
(anInt * anAngle degreesToRadians) sin)) * (anExtent - leafSize / 
(numbersOfLeafs sqrt))+ (anExtent - leafSize) /2) rounded.
	aCanvas fillOval: (aPoint extent: leafSize) color: leafColor].
aCanvas showAt: (Display center - (anExtent / 2)) rounded.
aCanvas fillColor: backgroundColor].
[Sensor anyButtonPressed] whileFalse: []] ensure: [Display restore]


More information about the Squeak-dev mailing list