Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!lll-tis!ptsfa!ihnp4!alberta!myrias!mj From: mj@myrias.UUCP (Michal Jaegermann) Newsgroups: comp.lang.forth Subject: Re: Debugging Aids for Forth Message-ID: <523@myrias.UUCP> Date: Fri, 21-Aug-87 16:01:23 EDT Article-I.D.: myrias.523 Posted: Fri Aug 21 16:01:23 1987 Date-Received: Sun, 23-Aug-87 06:17:12 EDT References: <3623@ihlpg.ATT.COM> <1516@crash.CTS.COM> Reply-To: mj@myriasa.UUCP (Michal Jaegermann) Organization: Myrias Research Corporation Lines: 28 Keywords: debug, trace I agree with all comments made here about Forth being its own symbolic debugger, writing small words with meanigful names and so on. Still one problem remains, exemplified by a novice tendency to use to many variables in a code. One - good - reason for that is that one cna be easily lost in a "stack jungle" created quite easily, even if your words are small and simply. And you need some experience and practice to discard all this "stack noise" (ROT, DUP, OVER, SWAP.....) when reading a code. One proposition was to execute "problem" words by typing components one by one. I am just too lazy for that, so in one of my Forth systems I included a tracing facility into a screen editor which I wrote (I was unhappy with the original editor). A certain key combinations caused an an execution of word (or two words - if needed) and display a stack contents at the bottom of a scree. A great debugging, teaching, learning ans demonstration tool. And very easy to implement in Forth, since all needed componenets are already in place - by the language design. Details may vary a little bit, due to implementations peculiarities, but basically you have to grab a string of characters from screen and move cursor past it (ENCLOSE willdo the job and provide information needed) change it to an address (this is a job of FIND) and pass it to inner interpreter to execute it (it was designed to do exactly that). That's all and some extra bells and whistles can be easily added. Michal Jaegermann Myrias Research Corporation Edmonton, Alberta, CANADA ....ihnp4!alberta!myrias!mj