Currently, in my opinion, j's handling of mapped files is broken.
You can use jmf to map a file to a name, but that mapping "leaks" to
other names. And this means that if you pass a reference to a large
mapped file and you get an exception in a function with a name (like
y) which references that file, the *debugger* will take a "copy" of
the value, and truncate it for display -- thus destroying the original
file.
In my opinion, the mapping should be locked to the original name and
locale which was specified usin map_jmf_ -- (alternatively, in my
opinion, there's really no point in specifying the name of the mapping
there if any name will do, but that seems like a bad design...)
In other words, instead of
MAP 4 :'x=.x,y' DATA
modifying the file, you would instead need something like
MAPNAME 4 :'(x)=:(".x),y' DATA
to modify the file
That said, when I look at jmf.ijs, I cannot see how and where this
name scope leakage happens. Something is happening there that I have
no clues about.
Does anyone understand this code?
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm