I happened to use the name "script" in something I was writing then found
that "load" stopped working. "load" uses "script" in the "z" locale making
"load" fail when I defined "script" in the current locale.
'echo ''Script loaded''' fwrite 'testing.ijs'
20
load 'testing.ijs'
Script loaded
script
[: 3 : '0!:0 y [ 4!:55<''y''' jpath_z_&.:>
script=:'trash'
load 'testing.ijs'
|syntax error: load
| fn fl
|[-8]
Modifying "load" to make sure that "trash" comes from the "z" locale as
follows corrected the problem.
load_z_=:3 : 0
0 load_z_ y
:
fls=. getscripts_j_ y
fn=. ('_z_',~'script',x#'d')~
for_fl. fls do.
if. Displayload_j_ do. smoutput > fl end.
if. -. fexist fl do.
smoutput 'not found: ',>fl
end.
fn fl
Loaded_j_=: ~. Loaded_j_,fl
end.
empty''
)
load 'testing.ijs'
Script loaded
Looking around in the "z" locale I noticed other verbs that assume names
come from the "z" locale. Like "boxopen" and "fboxname" in "fread" and
other file verbs. "nl" makes sure that it's reference to "cutopen" includes
the "_z_" in the name. So it's fixed.
Should these names be considered special names to be avoided? Or should all
of them be fixed? If so, I would volunteer to do it.
JVERSION
Engine: j903/j64avx2/windows
Release-b: commercial/2022-01-28T04:09:50
Library: 9.03.08
Qt IDE: 1.9.5/5.15.2(5.15.2)
Platform: Win 64
Installer: J903 install
InstallPath: c:/j903
Contact: www.jsoftware.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm