I just wanted to comment features of the default profile.ijs that I have
found confusing.
In the default profile.ijs, one of the first things done is to set the
noun PROFILE_z_ to be the pathname of the default profile.ijs if it is
not already defined. My current thinking is that if you were using a
custom profile (via -jprofile on the command line) then PROFILE_z_
should be set before the line.
if. notdef 'PROFILE' do. PROFILE_z_=: 1!:45'' end.
However later parts of profile.ijs (where the folder portion of PROFILE
is then used as a proxy for "the base folder of the J installation")
suggest to me that the idea is that PROFILE should always point to the
the default profile, whether a custom profile was used or not. If so
perhaps a better name would be PROFILEDEFAULT or PROFDEF or similar.
If in fact the idea is that PROFILE should point to the profile used
when J was started, perhaps this would be a useful change to the first
part of the script? (In other words if -
NB. =========================================================
NB. various global definitions
3 : 0 ''
notdef=. 0: ~: 4!:0 @ <
if. notdef 'ARGV' do. ARGV_z_=: ,<'undefined'
elseif. (<'-jprofile') e. ARGV do.
PROFILE_z_=: (>:ARGV i. <'-jprofile'){:: ARGV
end.
if. notdef 'PROFILE' do. PROFILE_z_=: 1!:45'' end.
PATHSEP_j_=: '/\'{~6=9!:12''
jhostpath_z_=: PATHSEP_j_ & (I. @ (e.&'/\')@] })
''
)
Again assuming that PROFILE should point to the profile used when
starting the current J session, then it may be more transparent to
assign the system folders like this:
NB. =========================================================
NB. create SYSTEMFOLDERS
NB. the entry for binary is added in boot.ijs
sep=. PATHSEP_j_
prf=. PROFILE {.~ PROFILE i: sep
bin=. (1!:45'') {.~ (1!:45'') i: sep
add=. bin,sep,'addons'
sys=. bin,sep,'system'
tmp=. bin,sep,'temp'
usr=. bin,sep,'user'
cfg=. usr,sep,'config'
hlp=. sys,sep,'extras',sep,'help'
hom=. (0&e. { ;&prf) 2!:5 'HOME'
ids=. ;: 'profile system addons temp user config help home'
SYSTEMFOLDERS_j_=: ids ,. prf;sys;add;tmp;usr;cfg;hlp;hom
I'm aware that the 'binary' system folder is added to these definitions
later during boot.ijs and I'm assuming there is a good reason that it is
not set here and so haven't fiddled with that.
If I'm barking up the wrong tree I'd appreciate it if someone would let
me know!
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm