>> I want to see >> inputs for verbs before and on the line 5,
What I usually do in a situation like that is put smoutput around line 5 If I can run it with the session manager open then you can display contents and some info like $ etc for everything you want. If you can not use session manager then you can send data to a file or to a locale outside your application J session manager is in a way a huge debugging facility. You can have your own variation of smoutput working differently depending on your own debug settings. 2009/12/30 Devon McCormick <[email protected]>: > 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 > -- Björn Helgason, Verkfræðingur Fornustekkum II 781 Hornafirði Po Box 127,801 Selfoss , t-póst: [email protected] gsm: +3546985532 sími: +3544781286 http://groups.google.com/group/J-Programming Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans góður kennari getur stigið á tær án þess að glansinn fari af skónum /|_ .-----------------------------------. ,' .\ / | Með léttri lund verður | ,--' _,' | Dagurinn í dag | / / | Enn betri en gærdagurinn | ( -. | `-----------------------------------' | ) | (\_ _/) (`-. '--.) (='.'=) ♖♘♗♕♔♙ `. )----' (")_(") ☃☠ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
