<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"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></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>
"look up ctxt method methodClass >> ctxt selector."<br>
"Save the code as normal"<br>
ctxt method become: ctxt method methodClass >> ctxt selector].<br></blockquote><div><br></div><div>All but the last line is sane ;-) You can't expect a become: to do the right thing. It'll leave the context's pc wrong, and perhaps its stack pointer too. You're looking for</div>
<div><br></div><div> ctxt privRefreshWith: ctxt method methodClass >> 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'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>