Hi,<div><br></div><div>Are you aware of any way to do this in the current Gambit version?</div><div><br></div><div>If not, Marc, what would be the way to implement this - Where in Gambit's code</div><div> - are ,b etc. defined, I suppose this is where the switch on/off for this feature should be located</div>
<div> - are the thread switches made, so that they can be disabled if in this mode?</div><div> - is the global best defined, that should contain the state for this feature.</div><div><br></div><div><div>I hope you see the utility of this kind of feature. Just as an example: you have a REPL in the primordial thread, and suddenly your http client thread crashes and you want to debug it, which involves accessing some of that thread's local variables by ,(v) , which can be made only when the REPL is in that thread.</div>
<div>     Currently afaik to get anywhere you need to do one REP (of 0 for example) in the primordial thread's REPL to compensate for the switches that are made automatically to there, of which one are made for each REP you do in the http client's thread. This is kind of cumbersome in debugging work, to need to evaluate 0 over and over again, and to have the console output from this and the thread switching to jump over on the screen all the time, when debugging. I.e.:</div>
</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>[in primordial thread]</div><div>> (work) (work) (work)</div><div>(result) > (result) > (result) > (work)</div>
<div>(result)</div><div>[suddenly:]</div><div><div>------------- REPL is now in #<thread #2> -------------</div></div><div> *** Error in http client etc.</div><div>1> ,(v some-var)</div><div>var-contents</div><div>
<div>------------- REPL is now in #<thread #1 primordial> -------------</div></div><div>> 0</div><div><div><div>------------- REPL is now in #<thread #2> -------------</div></div></div><div>1>,(v some-other-var)</div>
<div>var-contents</div><div><div><div>------------- REPL is now in #<thread #1 primordial> -------------</div></div></div><div><div>> 0</div></div><div><div><div><div>------------- REPL is now in #<thread #2> -------------</div>
</div></div></div><div>1></div><div>[etc.]</div></blockquote><div><br></div><div>What do you say of this feature, do you think this would be a good idea to include it in Gambit, or does it go better as a patch.</div><div>
<br></div><div>Kind regards,</div><div>Mikael<br><br><div class="gmail_quote">2010/12/22 Mikael <span dir="ltr"><<a href="mailto:mikael.trash@gmail.com">mikael.trash@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Gambit's default behavior is to switch thread after each REP in the repl. Is there a way to override this?</div><div><br></div><div>Thanks</div><div><br></div><div>(As an example, below I evaluate 1 2 3 4 in a sequence with two threads in the repl. Possibly something in the style of ,repl-stop-switching-between-threads 1 2 3 4 ,reset-repl-to-default-switching-mode could do it.</div>

<div><br></div><div>> 1</div><div>1</div><div>------------- REPL is now in #<thread #2> -------------</div><div>> 2</div><div>2</div><div>------------- REPL is now in #<thread #1 primordial> -------------</div>

<div>> 3</div><div>3</div><div>------------- REPL is now in #<thread #2> -------------</div><div>> 4</div><div>4</div><div>------------- REPL is now in #<thread #1 primordial> -------------</div><div>></div>

<div><br></div><div>)</div><div><br></div>
</blockquote></div><br></div>