Right now under the latest source code commits and also mocl 14.02, a simple array of element type '(unsigned byte 8) maps to NSData under Obj-C and byte under Java.
This means that if you call a call-in function like so:
byte bytes = ...;
Then inside the body of the lisp function foo, 'bytes' will be a lisp array of '(unsigned-byte 8).
Also, it should work with return types similarly, e.g.:
(declaim (call-in foo2))
(defun foo2 ()
(make-array 10 :element-type '(unsigned-byte 8)))
byte bytes = CL.foo2();
1) Lisp byte arrays must conform to the type '(simple-array (unsigned-byte 8) (*)), which allows mocl to have a typed array of bytes without boxing.
2) Under Java, the 'foo2' example above may return type 'Object' which needs to be cast to byte, or alternatively, mocl will statically define it as returning a byte if the type information is inferred or declared, e.g. by (declare (type (simple-array (unsigned-byte 8)) VAR-NAME)) or by (declaim (ftype ...)) of the call-in function.
Hope this makes sense. Let me know if you have any other questions or run into any issues.
- Wukix, 1152 days ago
Do I understand correctly 14.02 is available only for MacOS? Is it possible to release a Linux 64bit version also?