I have downloaded some free (advertising supported, but no redistribution rights) textbooks from wowio.com, and have been idly toying with writing a J accompaniment.
My thought is that I could create a .ijs file for a chapter or section, and while it could be executed manually a line at a time that I also wanted to be able to hit control-shift-w to review the script. While viewmat lends itself rather well to this approach (it spawns a new window every time it runs). For someone familiar with viewmat, plot seems to destroy the previous window every time it's run. Closer inspection shows that plot actually reuses the previous window. However: If someone runs open'jzplot' then accidentally types something and uses control-Z to undo that typing, they lose the contents of the window. This is one keystroke away from losing a significant chunk of J -- this seems too easy and of no particular benefit. Perhaps J should have a way of discarding undo history. While close inspection reveals a variable PForm which might allow the user to override plot's "reuse the plot window" behavior, setting this variable (for example, using plot's "new" or "use" commands) breaks the plot command. For example: 'use win2' plot i. 3 |length error: makepos_xywh I am not sure, reading the documentation why this should be. In other words, I don't know if fixing this would lead to stumbling over some other incompatible quirk later down the line, But by the same token I don't see any good reason for the current behavior. Anyways, perhaps this is of interest or use to someone. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
