Hi Chris,


usually, 'self halt' stops the execution of the current process indeed, as you can try out by typing the following into a workspace and doing it:


self halt.

self inform: 'Hello world'


You will see that you need to proceed the debugger window in order to get the Hello World message.


However, Squeak also supports multiprocessing, and it is possible that any code or tool you are using executes your method each time in a separate process. Here is a simple example of multiprocessing:


[self halt] fork.

self inform: 'Hello world'


You can see that the debugger opens, but the Hello World message is shown at the same time. This is because the #fork message created a new process that is running parallel to the first process. The halt message then only interrupts this second process.


I don't know your exact code and tools, but that seems a logical explanation to me. If you use a tool that enforces multiprocessing, you might take a look at the Semaphore class to synchronize the different method executions.


I hope I understood your issue correctly, have much fun with Squeak!


Best,

Christoph




Von: Beginners <beginners-bounces@lists.squeakfoundation.org> im Auftrag von mechanic <chrisgame@pobox.com>
Gesendet: Sonntag, 20. Oktober 2019 17:10 Uhr
An: beginners@lists.squeakfoundation.org
Betreff: [Newbies] Halt doesn't stop
 
Following Squeak + Robots, introducing a 'self halt' statement into a method
definition and expecting the program execution to stop and a debug window to
open. That window opens but the execution of the method continues, so in the
repeating pattern example I end up with three or four small 'pre debug
windows' I think they're called, and the pattern is drawn as it would be
without any such halt statement. Why wouldn't the program stop execution
when the halt statement is reached? That seems to be what the book
describes.



--
Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners