<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"><<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>></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> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Process>>currentProcess<br> "Answer the currently active process.<br> If the receiver is simulating another process,<br> answer the other process. If not, answer self."<br> ^currentProcess ifNil:[self]<br> <br> Process>>currentProcess: aProcess<br> "Set the currently active process.<br> Return the previous active process."<br> | prior |<br> prior := currentProcess.<br> currentProcess := aProcess.<br> ^prior<br> <br> ProcessorScheduler>>activeProcess<br> ^activeProcess currentProcess<br> <br> ProcessorScheduler>>currentProcess: aProcess<br> "For debugging only.<br> Pretend that aProcess is the activeProcess"<br> ^activeProcess currentProcess: aProcess<br> <br> and then:<br> <br> Debugger>>step<br> prior := Processor currentProcess: interruptedProcess.<br> [self doStep] ensure:[Processor currentProcess: prior].<br> <br> etc.</blockquote><div><br></div><div>Yes. 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. </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:) for the duration of each step?</div> </div></blockquote></div><div><br></div><div>Sounds like a trade-off between magic and simplicity. </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>