public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Arie van Wingerden <xapwing@gmail.com>
To: kawa@sourceware.org
Subject: Need some help with Java - Kawa interop
Date: Thu, 01 Nov 2018 13:45:00 -0000	[thread overview]
Message-ID: <CADkALSGg=9RURk9-kG6qGPMUUx4fnJeQEdP0BQFX+4AJOX__yw@mail.gmail.com> (raw)

Trying to generate a random color for a shape in JavaFX.
This (lines 7-9 are the binding of r, g and b):

> (define (randomColor)

  (let (

    (rnd (java.lang.Math:random))

    (r (java.util.Random:nextInt 255))

    (g (java.util.Random:nextInt 255))

    (b (java.util.Random:nextInt 255)))

  (Color:rgb r g b)))


Generates warnings:
.\test.scm:7:34: warning - type integer is incompatible with required type
java.util.Random
.\test.scm:8:34: warning - type integer is incompatible with required type
java.util.Random
.\test.scm:9:34: warning - type integer is incompatible with required type
java.util.Random
.\test.scm:7:8: warning - cannot convert literal (of type gnu.math.IntNum)
to ClassType java.util.Random
.\test.scm:8:8: warning - cannot convert literal (of type gnu.math.IntNum)
to ClassType java.util.Random
.\test.scm:9:8: warning - cannot convert literal (of type gnu.math.IntNum)
to ClassType java.util.Random

What am I doing wrong?

TIA

             reply	other threads:[~2018-11-01 13:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 13:45 Arie van Wingerden [this message]
2018-11-02  5:08 ` 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='CADkALSGg=9RURk9-kG6qGPMUUx4fnJeQEdP0BQFX+4AJOX__yw@mail.gmail.com' \
    --to=xapwing@gmail.com \
    --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).