On Fri, Oct 16, 2009 at 4:34 PM, danil osipchuk
<[email protected]> wrote:
> When I call GetM to fetch contents of a variable with a boxed data in
> it,  jdata appears to be an array of pointers to structures
> representing individual boxes. Is a description of the memory layout
> of this structure available somewhere?

The script j64-602/system/examples/dll/jdll.ijs provides some example,
but it too cannot read all types of data.  (Note: this is a different
file than what bill lam refers to.)

I for one was lazy to figure out how they work so I just use 3!:1 to
get a plain string from any noun, and transfer that string.  The
format 3!:1 uses to serialize boxes is documented, so you could access
it in your program.  On the other hand, I do this only because I want
to store the boxed array I get verbatim to later send it back to J, I
don't extract its contents expect in J, so calling 3!:1 isn't such a
waste of course.  The jep program in older versions of J also
transfers nouns in the same serialized format, so the versions of
jevalbot that use J 601 don't even have to do an explicit call to
3!:1.

Either way, you can't directly access the insides of bigints, bigrats,
or sparse arrays, because it's undocumented how either they're stored
or how 3!:1 serializes them, so if you needed to access these, you'd
need to extract their contents in J.

Ambrus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to