[newbie] Debugging Question.

Ned Konz ned at bike-nomad.com
Thu Aug 30 20:18:20 UTC 2001


On Thursday 30 August 2001 12:33 pm, Philip Knodle wrote:
> I'm relatively new to both Smalltalk and Squeak.  I'm wondering how I can
> debug my code.  How do I insert breakpoints in my code. 

Just send some object the "halt" message. A commonly used idiom is to say:

self halt doSomethingYouWantToWatch.

And then you can "next" into doSomethingYouWantToWatch.

> Also is there a
> Read-Eval-Print loop similar to the ones in LISP?  I've used the
> Workspaces, but I would prefer something closer to a REPL when debugging.

Almost any text area can do it, print it, etc. This includes the panes in the 
debugger. And there's keystroke commands for this, so you can go:

1+2<alt-P>

and it will print 3.

Since there's no keystroke input file stream as such, making something to 
read input, allow text editing, and eval/print is best done with existing UI 
components like the text morphs. But you could wire a couple together so that 
when you hit enter in the entry morph, the printed result would appear in the 
display morph.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list