HELP! with plugins

Eric Scharff Eric.Scharff at Colorado.EDU
Tue Sep 2 20:58:38 UTC 2003


(Apologies for nagging folks again, but I never received answers to any of
my plugin questions.  While creating plugins may not be nearly as exciting
as discussing licensing issues, it is far more important to my current
project. :) )

Here is a re-post of my latest plugin question:

I have a trivial plugin:

TestInterpreterPlugin subclass: #MyPlugin
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Eric-Test'

With a "primitive" method I intend to compile to C:

innerLoopX: x y: y limit: escape
	| |
	self
		primitive: 'primGuy'
		parameters: #(SmallInteger SmallInteger SmallInteger)
		receiver: #Oop.
	^ (escape + x + y) asOop: SmallInteger

(Note, simplified to do nothing useful, but illustrates the problem)

If I execute:

MyPlugin doPrimitive: 'innerLoopX:y:limit:' withArguments #(1 1 1)

I would expect to get 3.  Instead, I get a walkback:

Error: attempt to index non-existent element in an ordered collection

OrderedCollection(Object)>>error:
OrderedCollection>>errorNoSuchElement
OrderedCollection>>at:
InterpreterProxy>>stackValue:
InterpreterProxy>>stackIntegerValue:
MyPlugin>>DoItIn:
Compiler>>evaluate:in:to:notifying:ifFail:
[] in TestTMethod>>simulatePrologInContext:
Array(SequenceableCollection)>>keysAndValuesDo:
TestTMethod>>simulatePrologInContext:
MyPlugin(Object)>>primitive:parameters:receiver:
MyPlugin>>innerLoopX:y:limit:
MyPlugin class(TestInterpreterPlugin class)>>doPrimitive:withArguments:

What am I doing wrong?

-Eric




More information about the Squeak-dev mailing list