<div dir="ltr">Hi Frank,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 20, 2014 at 2:01 PM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I often use Blocks for holding tiny bits of state not worth<br>

formalising as a class. As a result, I often get this error because I<br>
also spend a lot of time developing in the Debugger.<br>
<br>
Is the following a completely crazy idea?<br>
<br>
self selectedContext activeHome ifNil: [ |ctxt|<br>
    ctxt := self selectedContext.<br>
    &quot;look up ctxt method methodClass &gt;&gt; ctxt selector.&quot;<br>
    &quot;Save the code as normal&quot;<br>
    ctxt method become: ctxt method methodClass &gt;&gt; ctxt selector].<br></blockquote><div><br></div><div>All but the last line is sane ;-)  You can&#39;t expect a become: to do the right thing. It&#39;ll leave the context&#39;s pc wrong, and perhaps its stack pointer too.  You&#39;re looking for</div>
<div><br></div><div>    ctxt privRefreshWith: ctxt method methodClass &gt;&gt; ctxt selector</div><div><br></div><div>But what do you want to do?  Are you rewriting a block as a block or as a method?  What yu have above will do the latter, not the former.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
You&#39;d need to fiddle the stack pointer, but that you have to do anyway<br>
in edit-and-continue.<br>
<span class=""><font color="#888888"><br>
frank<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>