public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: spellcard199 <spellcard199@protonmail.com>
To: Per Bothner <per@bothner.com>
Cc: Duncan Mak <duncanmak@gmail.com>,
	kawa mailing list <kawa@sourceware.org>
Subject: Re: Going from Scheme list to Java array
Date: Tue, 23 Jun 2020 11:10:52 +0000	[thread overview]
Message-ID: <Em4NHX5sPtdHCuzuubTxUPYplKOsB4Qv_CGtTvDyMzleQ3NV6jnQyFvQXW3Pc7xf3cjsudUR0_XoUrEjbdUIghrD7AI8vmCmd8qnGEHOXKE=@protonmail.com> (raw)
In-Reply-To: <60f49197-5651-bf5d-fa25-9c7472874875@bothner.com>

Hello. I tried looking it up (just out of curiosity) and it seems that
the method...

>    candidate: Type java.lang.Object[] java.util.List.toArray(ClassType
> java.util.function.IntFunction<null>)

... has been added between Java 8 and Java 11:

- https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html
- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html

How I found it: I used my Java IDE's "jump to definition" from a Java
project that has Kawa's Java API as a dependency, with the cursor over
".toArray":

  gnu.lists.LList l = gnu.lists.LList.makeList(new ArrayList());
  java.util.function.IntFunction f = (int x) -> null;
  l.toArray(f);


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, June 23, 2020 2:02 AM, Per Bothner <per@bothner.com> wrote:

> On 6/22/20 9:26 AM, Duncan Mak via Kawa wrote:
>
> > (define (into-array l ::java.util.List array-type)
> > (let* ((size (length l))
> > (array ((primitive-array-new array-type) size)))
> > (l:toArray array)))
> > (display (into-array (list 1 2 3) <int>))
> > When I run this in Kawa 3.1.1, this is what I see:
> > foo.scm:4:5: warning - more than one possibly applicable method 'toArray'
> > in java.util.List
> > candidate: Type java.lang.Object[] java.util.List.toArray(ClassType
> > java.util.function.IntFunction<null>)
> > candidate: Type java.lang.Object[]
> > java.util.List.toArray(java.lang.Object[])
>
> Not sure what is going on here. When I use Java 8, there is no problem.
> When I use Java 14, I get the same error. So it seems like something
> got added (after Java got default interface methods). However, I don't see
> it in the documentation here:
> https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/util/List.html
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>     --Per Bothner
>
>
> per@bothner.com http://per.bothner.com/



  parent reply	other threads:[~2020-06-23 11:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 16:26 Duncan Mak
2020-06-22 16:58 ` Per Bothner
2020-06-23  0:08   ` Per Bothner
2020-06-23  0:28     ` Duncan Mak
2020-06-23 17:23       ` Per Bothner
2020-06-23  0:02 ` Per Bothner
2020-06-23  0:05   ` Duncan Mak
2020-06-23 11:10   ` spellcard199 [this message]
2020-06-23 17:34     ` 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='Em4NHX5sPtdHCuzuubTxUPYplKOsB4Qv_CGtTvDyMzleQ3NV6jnQyFvQXW3Pc7xf3cjsudUR0_XoUrEjbdUIghrD7AI8vmCmd8qnGEHOXKE=@protonmail.com' \
    --to=spellcard199@protonmail.com \
    --cc=duncanmak@gmail.com \
    --cc=kawa@sourceware.org \
    --cc=per@bothner.com \
    /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).