<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 30.09.2010, at 19:30, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi All,<div><br></div><div>&nbsp;&nbsp; &nbsp;I just read Anthony Hallinan's most informative comment to SmartSyntaxPlugin class&gt;&gt;simulatorClass which says that</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;"By default SmartSyntaxInterpreterPlugin answers nil because methods in these plugins</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; are intended to be embedded in code that pushes and pops from the stack and therefore</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; cannot be run independently. &nbsp;This wrapper code is generated when translated to C. &nbsp;But,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; unfortunately, this code is missing during simulation. &nbsp;There was an attempt to simulate this,</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; but only the prologue code (getting arg from the stack) is simulated (see simulatePrologInContext:).</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;The epologue code (popping args and pushing result) is not. &nbsp;So I am making this nil until this can be fixed.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>Also, beware that primitive methods that take no args exactly match their primitive name (faking out</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;InterpreterSimulator&gt;&gt;callExternalPrimitive:). &nbsp;They should only be called from within wrapper code that</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;simulates the prologue and epilogue. &nbsp;Primitive method that take args don't have this accidental matching</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;problem since their names contain colons while their primitive names do not. - ajh 8/21/2002"</div>
<div><br></div><div>Strikes me that what needs to be done is to throw away the tricky implementation of Object&gt;&gt;#primitive:parameters:receiver:, replacing it by a simple direct implementation, and putting a wrapper around each SmartSyntaxPlugin primitive as its installed whose job it is to check for success and if so, cut back the stack and convert the result. &nbsp;Anyone interested who's not also hugely busy?</div>
<div><br></div><div>If so, focus on making LargeIntegersPlugin work using 22 factorial printString as a test case.</div><div><br></div><div>best</div><div>Eliot</div>
</blockquote><br></div><div>+1</div><div><br></div><div>I've gone back to not using&nbsp;SmartSyntaxInterpreterPlugin&nbsp;for pure Slang plugins so I can debug them in Squeak. For library wrappers I still use it since those can't be meaningfully debugged anyway.</div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>