NB. standard J profile
NB.
NB. 1. Definitions made here are required for the J development environment.
NB.
NB. 2. The following directory paths are defined (in SYSTEMFOLDERS_j_):
NB.    profile   - path to the profile file
NB.    system    - system files
NB.    temp      - temporary files
NB.    addons    - add on files
NB.    user      - user files
NB.    config    - user configuration path
NB.    home      - HOME, or same as profile if not defined
NB.    binary    - J binaries
NB.
NB. 3. Verb jpath builds full directory names from these paths.
NB.    For example, if the system directory is c:\j5 then:
NB.
NB.       jpath '~system/main/dates.ijs'
NB.    c:\j5\system\main\dates.ijs
NB.
NB. 4. To set up your own profile, for example to change the default
NB.    directory paths, first make a copy of this file, then change the
NB.    J startup parameter to point to the new file, e.g. under Windows:
NB.
NB.      c:\j5\j.exe -jprofile c:\jx\myprofile.ijs
NB.
NB. 5. You can add your own commands in the startup.ijs script,
NB.    see menu Edit|Configure|Startup in the J session.
NB.
NB. 6. JFE (J Front End) defines PROFILE_z_ as the full profile
NB.    filename, and defines ARGV_z_ as the command line args.
NB.    A profile at that location can redefine PROFILE_z_ and load it.

NB. =========================================================
NB. various global definitions
NB.
NB. Here, verb jhostpath converts between path separators / and \
NB. as required by the host system. For example, under Windows:
NB.       jhostpath 'system/main/dates.ijs'
NB.    system\main\dates.ijs
3 : 0 ''
notdef=. 0: ~: 4!:0 @ <
if. notdef 'ARGV' do. ARGV_z_=: ,<'undefined' end.
if. notdef 'PROFILE' do. PROFILE_z_=: 1!:45'' end.
PATHSEP_j_=: '/\'{~6=9!:12''
jhostpath_z_=: PATHSEP_j_ & (I. @ (e.&'/\')@] })
''
)

NB. =========================================================
NB. create SYSTEMFOLDERS
NB. the entry for binary is added in boot.ijs
sep=. PATHSEP_j_
prf=. PROFILE {.~ PROFILE i: sep
add=. prf,sep,'addons'
sys=. prf,sep,'system'
tmp=. (2!:5'HOME'),sep,'J/user'
usr=. (2!:5'HOME'),sep,'J/user'
cfg=. usr,sep,'config'
hom=. (0&e. { ;&prf) 2!:5 'HOME'
ids=. ;: 'profile system addons temp user config home'
SYSTEMFOLDERS_j_=: ids ,. prf;sys;add;tmp;usr;cfg;hom

NB. =========================================================
NB. boot up J:
NB. note: this may load a command line script, and should be
NB. the last entry in this script. Any additions beyond this
NB. point may confuse things and cause failures.
0!:0 <jhostpath sys, '\extras\util\boot.ijs'
