[plt-scheme] Distinguishing between pressing Run or Debug button in a tool

From: Robby Findler (robby at cs.uchicago.edu)
Date: Thu Jul 10 07:34:55 EDT 2008

I think the answer is that there is no after-execute because the
custodian handles all such cleanup. (It isn't clear when after-execute
would run -- typically the program uses the REPL so there is always
something running which means that any kind of close-down cleanup
action has to wait for the REPL to finish.)

I'm not sure if it is in the nightly build, but the change is to the
debugger so that it now has a debug-callback method that the
debugger's button invokes.

Robby

On Thu, Jul 10, 2008 at 3:54 AM, Robert Matovinovic
<robert.matovinovic at web.de> wrote:
> Unexpectedly I was out yesterday, so a belated answer.
>
>> -----Ursprüngliche Nachricht-----
>> Von: robby.findler at gmail.com [mailto:robby.findler at gmail.com]
>> Im Auftrag von Robby Findler
>> Gesendet: Mittwoch, 9. Juli 2008 15:58
>> An: Gregory Cooper
>> Cc: Robert Matovinovic; plt-scheme at list.cs.brown.edu
>> Betreff: Re: [plt-scheme] Distinguishing between pressing Run
>> or Debug button in a tool
>>
>>
>> On Wed, Jul 9, 2008 at 7:04 AM, Gregory Cooper
>> <greg at cs.brown.edu> wrote:
>> > I'm not sure I understand.  The debug button is itself part
>> of a tool,
>> > not part of the standard DrScheme interface, so writing
>> another tool
>> > that assumes it's there seems problematic.  Am I missing something?
>>
>> That's certainly true, but I think that Robert is willing to
>> make that assumption and is able to establish it, for his context.
>>
>
> That's what I'll do.
>
>> > Robby, your change certainly simplifies things, but it looks to me
>> > like the execute-callback will still be invoked along the main path
>> > through debug-callback.  Again, maybe I'm misunderstanding what the
>> > problem is.
>>
>> I think that's okay for Robert, since he can override the
>> debug-callback to be able to tell that the execute-callback
>> is being run for debugging. I don't know all of the details
>> he's dealing with, but he's fairly agressively changing the
>> behavior of DrScheme (in ways I certainly didn't plan for)
>> but they seem to be working out okay so far.
>>
>
> That sounds good to me. Is your change already in the nightly build version
> 4.0.2.3, updated at Wednesday, July 09 2008, 13:25 EDT? I'm not yet able to
> compile from sources.
>
>> > In general, my impression was "debugging = extra setup +
>> execution",
>> > so I don't see how to avoid making the debug button do
>> everything the
>> > execute button does (and then some).
>>
>> That sounds right.
>>
>
> Greg, you put it very clear for the debugger tool "debugging = extra setup +
> execution". What I want to do is something like
> "my setup + execution + my clean-up" for execution or
> "my setup + debugging + my clean-up" for debugging or even
> "extra setup + my setup + execution + my clean-up".
> What I actually do is
> "my execution" where everything is in a changed execute-callback function
>
> This is because I had to give up on "my clean-up". It would necessitate an
> after-execute method. And for clarity I don't used on-execute. For the
> debugger that doesn't work because it calls super execute-callback. So I
> wanted to work around that by changing the behavior of my execute-callback,
> when the debug button is pressed. But I didn't bear in mind that the
> debugger is a tool and not part of DrScheme.
>
> If I still need a workaround it will be to use on-execute with "my clean-up
> + my setup". So if there is anything to clean-up before the next execution
> it will be done. This is not very straightforward but will hopefully not
> have to many side effects. This approach also needs "my clean-up" on-close
> for the window and the tab.
>
> But all that raises my question: Why isn't there an after-execute method? I
> assume I miss an important point in the archtecture of DrScheme.
>
> Robert
>
>
>
>
>
>
>> One thing I wondered: is the debug? flag still necessary?
>>
>> Robby
>>
>> > Greg
>> >
>> > On Wed, Jul 9, 2008 at 7:31 AM, Robby Findler
>> <robby at cs.uchicago.edu>
>> > wrote:
>> >> Looking over the code debugger's code, I don't see why it
>> is written
>> >> like that. I have changed it to something that doesn't
>> make the docs
>> >> lie, but if one of the maintainers of the debugger were to
>> check it
>> >> over, that would be a good thing. (This is revision 10695.)
>> >>
>> >> Thanks,
>> >> Robby
>> >>
>> >> On Wed, Jul 9, 2008 at 2:12 AM, Robert Matovinovic
>> >> <robert.matovinovic at web.de> wrote:
>> >>> Hi,
>> >>> In creating a language tool so far I found no way to
>> distinguish if
>> >>> the debug or the run button was pressed. My tool overrides the
>> >>> execute-callback function of drscheme:unit:frame% and is called
>> >>> whenever Run or Debug is pressed. However the documentation says
>> >>> only it is called, when the Run button is pressed. This
>> is just for
>> >>> information no complaint about the behaviour, because I
>> want to do
>> >>> different things before debugging or run. Only that I can't do it
>> >>> the way I thought because I don't find a method like
>> is-clicked? or
>> >>> on-click for a switchable-button which would give me the
>> opportunity
>> >>> to know which one invoked the callback functions. Did I miss
>> >>> something? Thanks for your suggestions.
>> >>>
>> >>> Robert
>> >>>
>> >>> _________________________________________
>> >>> Robert Matovinovic
>> >>> Wintererstr. 61
>> >>> 79104 Freiburg
>> >>> Germany
>> >>>
>> >>> Tel:    +49 (0)761 51 93 544
>> >>> Cell:   +49 (0)171 56 32 330
>> >>> email: robert.matovinovic at web.de
>> >>>
>> >>> _________________________________________________
>> >>>  For list-related administrative tasks:
>> >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> >>>
>> >>>
>> >> _________________________________________________
>> >>  For list-related administrative tasks:
>> >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> >>
>> >
>> >
>>
>
>
>

Posted on the users mailing list.