Bill has done a nice job of clearing up the issue of the error the first time the script is run in a session. My less elegant solution was to set wdq='' in display_run if the name wasn't defined and then use :: to return 2 in update where there was an index error trying to set sidx.
To address some of your questions below > From: bob therriault > > One question I had was whether there is any risk of overwriting an > existing function with the line, display_z_=: display_rgtVisual_ I > checked and there are no existing verbs named display in the z locale, > but it seems to me that it may be possible to overwrite a verb of the > same name if it existed. It is certainly nice to have the convenience > of it in the z locale as it is easy to invoke from the .ijx window, > but I wouldn't want to cause unexpected side effects to other programs. Amoung other things locales provide a way of separating groups of nouns/verbs so that names don't collide. If you wish to make a name available globally by publishing it in the z locale then there is the risk that the same name already exists there and will be overwritten, or that your name will be overwritten by a name defined in a script that loads after yours. My only advice is to do what you've done already - be aware and check for existing verbs. If there are existing verbs you might need to choose a different name for yours. > p.s. Do you think this form is a useful tool? As a novice I find it > helps with the analysis of tacit expressions, but is that usefulness > an illusion when viewed from the perspective of an advanced J > programmer? I certainly agree that the different representations of tacit expressions help with understanding them. I'm not sure though that the gui form provides much more utility than the facility that already exists in the session. Type your tacit expression in the session without arguments, hit Enter, and its representation(s) will be displayed in the session. If you want a different representation, or more than one type you can use Edit|Configure|Display and tick "Allow Multiple Selections" and then tick one or more of Linear, Box, Tree and Parens. The GUI form does keep the representations separate to the session, which may reduce session clutter. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm