> it sounds like you've re-discovered why global variables are bad practice

Yes, I know that. The reason I've used them is, of course, they seemed to be 
more convenient than alternatives.

I'm writing a parser generator. From the input grammar, which is a string, I 
create some tables - nonterminals, rules... Then I build some functions, which 
essentially lookups in yet other tables, calculated along the way. The parser 
driver maintains some other tables. It's certainly possible to pass them all 
around, just not very convenient.

I've done some restructuring already, and don't see immediately how to further 
simplify structures - without performance penalties, which (prematurely) 
weren't hailed much by, IIRC, Knuth.

> 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.

Thanks for tips. I'm not sure I know what J session manager is; I'm just 
developing with J console and an *.ijs windows open.

Alex



      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to