[BUG][FIX] InterpreterPlugin>>doPrimitive: and friends (was: RE: HELP! with plugins)

Andreas Raab andreas.raab at gmx.de
Tue Sep 2 22:20:47 UTC 2003


Hi,

This is a bug. Attached is a version which fixes these problems. If you are
running pre-3.6 you'll have to substitute TestInterpreterPlugin for
SmartSyntaxInterpreterPlugin as it is named in 3.6.

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Eric Scharff
> Sent: Tuesday, September 02, 2003 10:59 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: HELP! with plugins
> 
> 
> (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
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FixDoPrimitive-ar.cs
Type: application/octet-stream
Size: 1516 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030903/3a206a1c/FixDoPrimitive-ar.obj


More information about the Squeak-dev mailing list