This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Java arrays to Scheme
- From: Peter Lane <peter at peterlane dot info>
- To: kawa at sourceware dot org
- Date: Fri, 3 Feb 2017 20:33:16 +0000
- Subject: Java arrays to Scheme
- Authentication-results: sourceware.org; auth=none
Hi list,
I'm trying to understand how to interact with Java functions which
return arrays, e.g. double[][] or int[].
When I call a function which returns an int[] or double[][] they display
as numbers within [ ... ] square brackets. I can extract their length
and elements, e.g. using (x 0) etc where x is the array.
What kind of object are these in the Scheme universe? array? vector?
and the uniform vector tests return #f.
I tried an idea I found under uniform vectors, to try to make a uniform
vector share the Java array, but I only get type errors.
I would like to convert these Java arrays into a Scheme list or vector,
which should be a simple function to write. But is there a
function/trick like that already?
thanks,
Peter.
--
Peter Lane
http://peterlane.info/scheme.html