<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 17.07.2009, at 06:16, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Thu, Jul 16, 2009 at 6:26 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Didn't we talk about this earlier?</blockquote><div><br></div><div>Yes we had discussed it, but I needed the reminder...</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Process&gt;&gt;currentProcess<br> &nbsp;"Answer the currently active process.<br> &nbsp;If the receiver is simulating another process,<br> &nbsp;answer the other process. If not, answer self."<br> &nbsp;^currentProcess ifNil:[self]<br> <br> Process&gt;&gt;currentProcess: aProcess<br> &nbsp;"Set the currently active process.<br> &nbsp;Return the previous active process."<br> &nbsp;| prior |<br> &nbsp;prior := currentProcess.<br> &nbsp;currentProcess := aProcess.<br> &nbsp;^prior<br> <br> ProcessorScheduler&gt;&gt;activeProcess<br> &nbsp;^activeProcess currentProcess<br> <br> ProcessorScheduler&gt;&gt;currentProcess: aProcess<br> &nbsp;"For debugging only.<br> &nbsp; Pretend that aProcess is the activeProcess"<br> &nbsp;^activeProcess currentProcess: aProcess<br> <br> and then:<br> <br> Debugger&gt;&gt;step<br> &nbsp;prior := Processor currentProcess: interruptedProcess.<br> &nbsp;[self doStep] ensure:[Processor currentProcess: prior].<br> <br> etc.</blockquote><div><br></div><div>Yes. &nbsp;This is OK, but it means the system codes to suit the debugger and that's always felt like the tail wagging the dog to me.&nbsp;</div><div><br></div><div>How about creating an anonymous subclass of the process that implements activeProcess</div></div></blockquote><div><br></div><div>#activeProcess is implemented by ProcessorScheduler not Process. So that won't work.</div><br><blockquote type="cite"><div class="gmail_quote"><div> to raise an exception caught by the debugger that answers the right thing and class (to answer the proper class) and using adoptInstance: (the new guts of changeClassTo:) &nbsp;for the duration of each step?</div> </div></blockquote></div><div><br></div><div>Sounds like a trade-off between magic and simplicity.&nbsp;</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="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div><br class="Apple-interchange-newline"></div></span> </div><br></body></html>