[Newbies] Stef, BotsInc problem...
David Urquhart
david.urquhart at hotmail.com
Tue Jan 23 00:05:18 UTC 2007
Hi Blake
I could be well off base here - I'm a beginner too!
Bert told me... "doOnlyOnce:" is essential for not getting a gazillion of
debuggers. Read its comment to learn how to rearm it.
Here's how Bert suggested it be used with 'halt'.
self doOnlyOnce: [self halt].
As for why the system keeps running I can only suggest that its by design.
Squeak is different to other languages because its actually an environment,
and a remarkable environment with 'late binding' such that objects (classes
and instances) can be dynamically changed during runtime. So you can debug
- actually change code - without stopping the system.
Of course you may WANT to stop the system because defective code could be
dangerous - but that would be different to what should be default behaviour
for a debugger in the context of Squeak. To actually stop your code you'd
have to send it a message that it can handle I guess :) You'd need a
'freeze' method.
Dave
DAVID URQUHART
>From: Blake <blake at kingdomrpg.com>
>Reply-To: "A friendly place to get answers to even the most basic
>questionsabout Squeak." <beginners at lists.squeakfoundation.org>
>To: "A friendly place to get answers to even the most basic questions
>aboutSqueak." <beginners at lists.squeakfoundation.org>
>Subject: [Newbies] Stef, BotsInc problem...
>Date: Mon, 22 Jan 2007 14:47:27 -0800
>
>Stef,
>
> I'm doing the Bots Inc thing with my son and we have a problem on the
>debugging section. When we code
>
>self halt.
>
> That brings up the debugger and then continues. It doesn't halt!
>
> Done inside the 4 timesRepeat loop, it brings up four debuggers, all
>useless because the program keeps going and terminated before you can do
>anything with it.
>
> Anyone have any ideas?
>
> ===Blake===
>_______________________________________________
>Beginners mailing list
>Beginners at lists.squeakfoundation.org
>http://lists.squeakfoundation.org/mailman/listinfo/beginners
More information about the Beginners
mailing list