ifCurtailed prompts debug window

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ifCurtailed prompts debug window

Vitor Medina Cruz
Hello,

On Windows 10 and Pharo 8, If I do:

[ Error signal ] ifCurtailed: [ Transcript show: 'error' ].

the debug window pops up, when I close, 'error' is print in the Transcript. If I do

[ Error signal ] on: Error do: [ Transcript show: 'error' ].

'error' is print in Transcript without debug windows pops up. I was expecting the same behavior here, as if ifCurtailed was a syntax sugar for on:do:, that is not the case or it is some kind of error? The way it is, I cannot use ifCurtailed because I don't want the debug window to pup up.

Regards,
Vitor
Reply | Threaded
Open this post in threaded view
|

Re: ifCurtailed prompts debug window

Richard Sargent
Administrator
On Fri, May 15, 2020 at 10:00 AM Vitor Medina Cruz <[hidden email]> wrote:
Hello,

On Windows 10 and Pharo 8, If I do:

[ Error signal ] ifCurtailed: [ Transcript show: 'error' ].

the debug window pops up, when I close, 'error' is print in the Transcript. If I do

That is correct. It isn't curtailed until the default handler finishes and drops the stack frames. In this case, the default handler opens the debugger. When you terminate the debugger, you curtail the execution, not before.


[ Error signal ] on: Error do: [ Transcript show: 'error' ].

'error' is print in Transcript without debug windows pops up. I was expecting the same behavior here, as if ifCurtailed was a syntax sugar for on:do:, that is not the case or it is some kind of error? The way it is, I cannot use ifCurtailed because I don't want the debug window to pup up.

Regards,
Vitor
Reply | Threaded
Open this post in threaded view
|

Re: ifCurtailed prompts debug window

Vitor Medina Cruz
Thanks!

I will use on:do: so.

On Fri, May 15, 2020 at 2:12 PM Richard Sargent <[hidden email]> wrote:
On Fri, May 15, 2020 at 10:00 AM Vitor Medina Cruz <[hidden email]> wrote:
Hello,

On Windows 10 and Pharo 8, If I do:

[ Error signal ] ifCurtailed: [ Transcript show: 'error' ].

the debug window pops up, when I close, 'error' is print in the Transcript. If I do

That is correct. It isn't curtailed until the default handler finishes and drops the stack frames. In this case, the default handler opens the debugger. When you terminate the debugger, you curtail the execution, not before.


[ Error signal ] on: Error do: [ Transcript show: 'error' ].

'error' is print in Transcript without debug windows pops up. I was expecting the same behavior here, as if ifCurtailed was a syntax sugar for on:do:, that is not the case or it is some kind of error? The way it is, I cannot use ifCurtailed because I don't want the debug window to pup up.

Regards,
Vitor
Reply | Threaded
Open this post in threaded view
|

Re: ifCurtailed prompts debug window

Ben Coman
In reply to this post by Vitor Medina Cruz
With the first, you are not defining for the Error to be handled, 
only what to do when the stack unwinds abnormally.

In the second you are defining for the Error to be handled, so it does that.

cheers -ben 

On Sat, 16 May 2020 at 01:00, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

On Windows 10 and Pharo 8, If I do:

[ Error signal ] ifCurtailed: [ Transcript show: 'error' ].

the debug window pops up, when I close, 'error' is print in the Transcript. If I do

[ Error signal ] on: Error do: [ Transcript show: 'error' ].

'error' is print in Transcript without debug windows pops up. I was expecting the same behavior here, as if ifCurtailed was a syntax sugar for on:do:, that is not the case or it is some kind of error? The way it is, I cannot use ifCurtailed because I don't want the debug window to pup up.

Regards,
Vitor
Reply | Threaded
Open this post in threaded view
|

Re: ifCurtailed prompts debug window

Richard O'Keefe
Also, #ifCurtailed: is supposed to fire if there's a long return that would have passed through it, while #on:do: doesn't care about long returns in the least.

On Sat, 16 May 2020 at 15:27, Ben Coman <[hidden email]> wrote:
With the first, you are not defining for the Error to be handled, 
only what to do when the stack unwinds abnormally.

In the second you are defining for the Error to be handled, so it does that.

cheers -ben 

On Sat, 16 May 2020 at 01:00, Vitor Medina Cruz <[hidden email]> wrote:
Hello,

On Windows 10 and Pharo 8, If I do:

[ Error signal ] ifCurtailed: [ Transcript show: 'error' ].

the debug window pops up, when I close, 'error' is print in the Transcript. If I do

[ Error signal ] on: Error do: [ Transcript show: 'error' ].

'error' is print in Transcript without debug windows pops up. I was expecting the same behavior here, as if ifCurtailed was a syntax sugar for on:do:, that is not the case or it is some kind of error? The way it is, I cannot use ifCurtailed because I don't want the debug window to pup up.

Regards,
Vitor