public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Alcides Flores Pineda <alcides.fp@gmail.com>,
	 Kawa Mailing List <kawa@sourceware.org>
Subject: Re: Strange ClassCastException
Date: Sun, 21 Sep 2014 07:54:00 -0000	[thread overview]
Message-ID: <541E8409.5010502@bothner.com> (raw)
In-Reply-To: <8761ghwobe.fsf@vostro1520.AFP-HOME>



On 09/20/2014 10:11 PM, Alcides Flores Pineda wrote:
> So, my question is: Is this a known bug/feature?

It's a bug.  Originally, Kawa arithmetic only worked for "Kawa numbers"
i.e. the classes is gnu.math.  But at this point you're supposed to
be able to mix and match "Kawa numbers" and "Java numbers".

The error "java.lang.Double cannot be cast to gnu.math.Numeric" is because
we're using a raw cast to gnu.math.Numeric (i.e. a Kawa numbers), though
the actual return type in this case is a "Java number".  We need to
either use a "smart cast" (i.e. gnu.kawa.listexpr.LangObjType.coerceNumeric)
or fix the return type.

The former is a only line fix, but I should also consider tweaking the
calculated return type.

> Should I submit a bug report?

Not needed.  (But if I don't report a fix in a day or two, remind me.)

> Is it not-recommended to mix Java and Scheme library functions?

It's supposed to work.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2014-09-21  7:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-21  5:16 Alcides Flores Pineda
2014-09-21  7:54 ` Per Bothner [this message]
2014-09-22  6:54 ` Per Bothner
2014-09-22 16:22   ` Alcides Flores Pineda

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=541E8409.5010502@bothner.com \
    --to=per@bothner.com \
    --cc=alcides.fp@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).