<br><br><div class="gmail_quote">On Tue, Mar 3, 2009 at 7:09 AM, John M McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Do you think we could change Slang so that it wouldn&#39;t return anything if the procedure returns nothing? Thus avoid all these sqInt foo() {}  **warning does not return value messages</blockquote><div><br></div><div>Already done.  I have a slew of Slang changes that will get released with Cog.  I&#39;ll try and write-up a list sometime soon.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div><span id="q_11fccf390ccc9f3f_1" class="h4">- Show quoted text -</span></div><div class="h5">
<br>
<br>
On 2-Mar-09, at 11:24 PM, Andreas Raab wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Folks -<br>
<br>
Ever since we started to use the Stack VM we had a series of subtle crashes, many of which we could trace to stack imbalances (i.e., mismatching numbers of push/pops in primitives). Since the Stack VM is much more affected by this we have been looking to fix these issues once and for all.<br>

<br>
One thing that occurred to us is that practically all primitives do the same: They pop the number of arguments and they push an optional return value. There are many ways in which this can get wrong, sometimes it&#39;s a subtle early return, sometimes the fact that the primitive has actually failed before the prim returns etc.<br>

<br>
One thing that all of the uses (in plugins) have in common that all the plugin *really* needs to do, is to provide a return value and leave the push/pop to be done by the VM. In this case the stack invariants wouldn&#39;t even be exposed to the plugin.<br>

<br>
What we are doing right now is along those lines - basically we are replacing push/pop in the interpreter proxy by variants that don&#39;t actually do push and pop. Rather than that, pop is ignored (it only remembers how many times you popped so we can track inconsistencies) and push remembers the return value.<br>

<br>
This should definitely be replaced at some point by a proper #primitiveReturnValue: call. I was wondering what people think about the possibility of automatically rewriting plugins to fix those uses? It should be reasonably easy to find all the uses of &quot;interpreterProxy pop: foo&quot; and just remove them and replace &quot;interpreterProxy push[Float|Int]:&quot; with &quot;interpreterProxy primitiveReturn[Float|Int]:&quot;.<br>

<br>
Cheers,<br>
 - Andreas<br>
</blockquote>
<br></div></div><font color="#888888">
--<br>
===========================================================================<br>
John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;<br>
Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com" target="_blank">http://www.smalltalkconsulting.com</a><br>
===========================================================================<br>
<br>
<br>
<br>
</font></blockquote></div><br>