> From: bob therriault > Sent: Sunday, 3 May 2009 03:36 > > The coerase use off the top to clear global variables is something I > have not seen before and that surprises me as I would have thought > that it would be essential (but I may be missing the nuances of other > programs).
I think the intention of this line is to help debugging by clearing out any global nouns, that may have been initialized when previously running the form. It helps uncover problems that might otherwise only be found the first time that the script is run in a J session. I imagine that in the final script you'd probably remove it. > It is fascinating to see the evolution of this program and the impact > of style and expertise. Agreed! The evolution of this program and the advice along with it probably has the makings of a worthwhile wiki article. I always find advice much more useful when accompanied with realistic examples of how to put it in to practice - as in this thread. > > I still wonder about assigning display to the z locale. I think this > may be part of Oleg's suggestion for a new name, 'disprep', but I am > concerned that the user would have to know which names are already in > the z locale (no matter how obscure) before they safely used this > program. Two solutions I have thought about are checking the z locale > programmatically before assigning, or making this script a class and > the form an object instance. I'm working on my object oriented > understanding, so this may be a silly suggestion. I agree that this is probably the issue that Oleg was addressing with his new name. I don't think that making the form an object instance would help - you would still need some name in the z locale to make form available globally. I toyed with making the form an object for my first script. One advantage is that you can run multiple instances of the form at once, but for this case I agree with your initial decision to reuse an existing instance if present - that technique (refined by Oleg) was something new that I learnt from your initial post. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm