I think that the contrast between

http://www.jsoftware.com/help/user/call_procedure.htm and
http://www.jsoftware.com/help/user/memory_management.htm is worth
calling out.

The call procedure supports these types:

c  J character (1 byte)
w  J unicode (2 byte) (see u:)
s  short integer (2 byte)
i  integer (4 byte)
l  long integer (8 byte)
x  J integer (4 byte or 8 byte depending on 32/64)
f  short float (4 byte)
d  J float (8 byte)
j  J complex (16 byte - 2 d values) (pointer only, not as result or scalar)
*  pointer
n  no result (result, if any, is ignored and 0 is returned)

The memory management system instead supports these types:

type parameter is 2 4 8 or 16 for char integer float or complex. The
default is 2.

Now... there's a certain amount of flexibility available by treating
memory as bytes and doing all the translations in J. And, of course,
you can use the integer/floating conversions documented at
http://www.jsoftware.com/help/dictionary/dx003.htm for this.

Still... this is a bit awkward.

So, questions:

(1) Would it be reasonable to define dyadic cases for the 15!:n
foreigns, where the left hand argument is a type specifying character?

(2) Would it be reasonable to support an analogous mechanism for 3!:n
conversion foreigns?

(3) Would it be reasonable to support sequences of characters for
reading structures?

The purpose would be reading memory (or possibly files) written by
foreign languages.

Obviously, no rush, and of course any example problem can easily
become open-ended.

But it's something to think about.

Thanks,

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

Reply via email to