Download A Brief J Reference
Transcript
21 22 Scripts Scripts are plain text files containing J expressions. Typically the file extension is .ijs. Loading the scripts runs the J expressions. Ctrl+N 0!:0 <'filename.ijs' 0!:1 <'filename.ijs' open a new script window run the script filename.ijs; note boxing of filename run the script with display 0!:0 y 0!:1 y 0!:10 y run the J noun y as a script run the J noun y displaying the result run the J noun y and continue on errors load 'filename.ijs' similar to 0!:0 except that the script is loaded within an explicit definitions, and hence local definitions in the script do not exist upon completion. This allows a script to have definitions that are local to the script. loads a library script, for example pacman is the script system/util/pacman.ijs. Enter scripts'v' to see the list of script names. loads a script from the addons directory, for example load '~addons/stats/r/rserve.ijs' similar to load except that if the script has already been loaded, it is not loaded again. load 'scriptname' load '~addons/../filename.ijs' require 'filename' Typically, applications are built from several scripts. The Project system helps you access and manage your J script files. For example, it lets build you applications from several scripts. Scripts are maintained individually during development, and can be compiled into a single output script for distribution/runtime/installation purposes. You can customize the build to suit your application. For more information, see the wiki pages Guides/Folders and Projects and Guides/J8 Standalone.