Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

J language's "load" command

Tags:

installation

j

I'm working through the J primer, and getting stuck when it comes to the load command.

In particular, there are times when the next step in a tutorial is load 'foo' and I'll get an error like the following:

   load 'plot'
not found: /users/username/j64-801/addons/graphics/plot/plot.ijs
|file name error: script
|       0!:0 y[4!:55<'y'

When I do ls /users/username/j64/addons/ I only have config and ide in there, so it's sensible that graphics is not found.

My question: if given an example that says load 'foo', how do I go about finding and installing foo?

like image 358
Alex Shroyer Avatar asked May 19 '14 20:05

Alex Shroyer


People also ask

What does slab command do on jmol?

The Slab Plane option moves the slab plane closer or further away from you when you move the mouse up or down. ***Opening the Jmol menu only requires a right mouse click (Windows) or held mouse click (Macintosh). The menu gives a multitude of options to manipulate the display which are best learned by practice.

How do I start Julia in terminal?

1.6. For this, we will use the integrated terminal in VS Code. Recall that you can start this directly from the command palette with <Ctrl+Shift+P> then typing part of the > Julia: Start REPL command.

How do I run Julia script?

Running code You can run a Julia file (via Ctrl+F5, which will run whatever Julia file you have open and active), execute Julia commands via the REPL, or even execute a specific block of code from a file you have open.


1 Answers

I'd recommend simply installing all the JAL packages ("Addons"). There aren't too many, so the download won't take long, and you'll have access to everything you need to run the Labs, Wiki examples, and any code posted by the community (e.g. on the J Forums).

To install all available Addons, type the following into Jconsole (you could theoretically type it into JHS or JQT instead, but since those are distributed as Addons, you might not be able to upgrade them while they're running):

   load'pacman'  NB. J PACkage MANager
   install'all'

The package manager will start running, and you'll see output like:

Updating server catalog...
Installing 52 packages
Downloading base library...
Installing base library...
Downloading api/gl3...
Installing api/gl3...
Downloading api/ncurses...
Installing api/ncurses...

Then stop and restart Jconsole, and run:

   load 'pacman'
   'update' jpkg 'all'

To make sure all recursive dependencies were satisfied and all packages are up to date (in particular, the base library). Ultimately, you want to see something like:

Updating server catalog...
Local JAL information was last updated: <datetime>
All available packages are installed and up to date.

Then stop & restart J one last time. When that's done, you should have everything you need to run the Labs.


To answer your final question, if you see a line like:

   load'foo'

The first thing you should do is run getscripts_j_ 'foo'. In your example:

   getscripts_j_ 'plot'
+--------------------------------------------------------------+
|c:/users/user/j64-801/addons/graphics/plot/plot.ijs|
+--------------------------------------------------------------+

Here, you can see the fully-qualified path of where J expects the package to live.

In particular, you can see it where it is relative to the addons directory, which will always be in the form addons/category/module/foo.ijs. The category and module name indicate which addon you need to install, so all you have to do pick the desired entry from the catalog visible in the package manager.

like image 188
Dan Bron Avatar answered Jan 01 '23 10:01

Dan Bron