public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Java arrays to Scheme
@ 2017-02-03 20:33 Peter Lane
  2017-02-03 23:24 ` Per Bothner
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Lane @ 2017-02-03 20:33 UTC (permalink / raw)
  To: kawa

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-03 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03 20:33 Java arrays to Scheme Peter Lane
2017-02-03 23:24 ` Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).