Alex - it sounds like you've re-discovered why global variables are bad practice - this is a well-trodden road to difficulty. If you pass the arguments to the functions in which they are used, then debug takes care of all the resetting and such for you, when you, for instance, cut back the stack for another run at the failing function.
Is there any reason you can't pass arguments to functions and make the localization mechanism work in your favor? Good luck, Devon On Tue, Dec 29, 2009 at 4:32 PM, Alexander Mikhailov <[email protected]>wrote: > I'm trying to learn debugging in J. It does seem to be much different from, > say, C++. Now I've got a specific question which I'd like to ask. > > Suppose I have verb AA, which in its body calls verb BB, which in turn > calls verb CC. When I run AA, for some input data I'm getting exception, > which shows me a line in verb CC, say, line 5. > > My verbs do have side effects (I use global variables). How can I debug the > problem in CC after getting the exception? "Debug" means that I want to see > inputs for verbs before and on the line 5, to figure out which data is > incorrect. I can't resume - repeat the line - the execution from the same > point within CC, and to run AA again, I have first to revert globals to > their original state. I feel this is approach foreign for J, but I'm not > sure how I should proceed with debugging in general here. > > Can you suggest practical approaches here? > > Alex > > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
