[gambit-list] Possible do several REP:s in a sequence in the current thread in the REPL, if several threads are in the repl at the same time?

Mikael mikael.trash at gmail.com
Wed Dec 29 04:58:35 EST 2010


Hi,

Are you aware of any way to do this in the current Gambit version?

If not, Marc, what would be the way to implement this - Where in Gambit's
code
 - are ,b etc. defined, I suppose this is where the switch on/off for this
feature should be located
 - are the thread switches made, so that they can be disabled if in this
mode?
 - is the global best defined, that should contain the state for this
feature.

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.
     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.:

[in primordial thread]
> (work) (work) (work)
(result) > (result) > (result) > (work)
(result)
[suddenly:]
------------- REPL is now in #<thread #2> -------------
 *** Error in http client etc.
1> ,(v some-var)
var-contents
------------- REPL is now in #<thread #1 primordial> -------------
> 0
------------- REPL is now in #<thread #2> -------------
1>,(v some-other-var)
var-contents
------------- REPL is now in #<thread #1 primordial> -------------
> 0
------------- REPL is now in #<thread #2> -------------
1>
[etc.]


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.

Kind regards,
Mikael

2010/12/22 Mikael <mikael.trash at gmail.com>

> Gambit's default behavior is to switch thread after each REP in the repl.
> Is there a way to override this?
>
> Thanks
>
> (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.
>
> > 1
> 1
> ------------- REPL is now in #<thread #2> -------------
> > 2
> 2
> ------------- REPL is now in #<thread #1 primordial> -------------
> > 3
> 3
> ------------- REPL is now in #<thread #2> -------------
> > 4
> 4
> ------------- REPL is now in #<thread #1 primordial> -------------
> >
>
> )
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20101229/099b932c/attachment.htm>


More information about the Gambit-list mailing list