public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Peter Lane <peter@peterlane.info>
To: kawa@sourceware.org
Subject: Java arrays to Scheme
Date: Fri, 03 Feb 2017 20:33:00 -0000	[thread overview]
Message-ID: <875fc6cc-c8e6-7eca-4b47-4f02e6195df4@peterlane.info> (raw)

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

             reply	other threads:[~2017-02-03 20:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 20:33 Peter Lane [this message]
2017-02-03 23:24 ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875fc6cc-c8e6-7eca-4b47-4f02e6195df4@peterlane.info \
    --to=peter@peterlane.info \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).