LoBrow: a browser to examine the contents of any J locale
This is the version supporting the treatment below: lobrow_OLD2.ijs
This is a newer (beta) version, with a lot more functionality: lobrow.ijs
(J602 and JGTK, port underway to J701 JHS)
How to use it
Run: lobrow.ijs (downloaded as above). You'll see the main form appear:
Click the name of a locale (in this case: z).
You'll see the lower listbox fill up with the names of objects in the chosen locale.
You can shorten the list by clicking the checkboxes: Nouns Adverbs Conjuncts Verbs.
Click the name of an object (in this case the verb fcopynews).
Its definition appears in the big panel.
You can edit the object conventionally by clicking button 'Edit'.
The displayed text appears in a new .ijs window.
Make changes and do Menu: Run > Window as you would normally.
Click the box +Locale.
The object name in the big panel gets suffixed by its locale.
When you edit this definition in a new .ijs window, it will be put straight back into its proper locale.
You can view the definition of a noun, too.
Here we see the noun LOBROW in the locale: 'lobrow'. It happens to be the form definition, as created by the J Form Editor.
In this format it's often good for writing back with minor changes, since it is in a format which will re-execute to rebuild the original object. (It's not always in such an illegible form).
But sometimes you want to read the text as though you had simply entered LOBROW in the J session.
Click checkbox: As Text.
You'll see the big panel change into something more readable. (This only works with nouns.)
Other things you can do:
* LoBrow takes snapshots of each panel display. You can browse earlier displays by clicking the buttons <- and ->. Get back to the latest display by clicking button -->||.
* Copy/paste the big panel by button Copy. This lets you paste a definition into a script you've already got open.
Use LOBROW as an IDE (Interactive Development Environment) at your own risk!
I do, a lot, in fact I use it to maintain LOBROW itself (the script bears evidence of that)
but I'm cautious to save IJS-dumps frequently.
JSoftware recommends you develop a J application as a collection of txtfiles (of type IJS). It's possible to use LOBROW to edit J objects in-place, saving/dumping the entire locale as a reloadable script. This resembles APL in its use of workspaces (wss). But if LOBROW crashes, you can lose your work. This is less of a risk, and easier to clean-up, if you maintain your app as a collection of IJS scripts.
- The best use of LOBROW is as a took to inspect an existing app, eg the locales _j_ and _jijs_, making ad-hoc modifications to clarify how the code works.
(e.g. to insert smoutput lines into verbs.)
I want to make a better verb: linearized. The idea is to produce a LF-delimited string which displays in 'panel' as if you'd typed the name of the noun into the session. It works with 2-D char arrays, but doesn't work well for boxed vars. IanClark
- If I did provide a button to write back an updated definition, then it could record which Tnnnn snapshot-noun this was done for,
allowing that list of Tnnnn's to be printed-out at the end-of-session as a script of changes. IanClark
If I'd known about Oleg's Cobrowse, I wouldn't have made the effort to write LoBrow. I now view my effort as largely of academic interest. But it's maybe instructive for someone at my stage of learning J. Also I can adapt it with confidence. IanClark 2010-01-20 11:58:00
- Updated version uploaded, with new buttons:
Save -saves updated definition
Script -outputs current locale in a new script window
Open^, Edit^ -work on name beneath the cursor
Info -writes Info box back as a noun: currentObj_INFO, to help document currentObj.
-- IanClark 2010-02-01 15:45:23
Contributed by IanClark