This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Strange ClassCastException
- From: Alcides Flores Pineda <alcides dot fp at gmail dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: Kawa Mailing List <kawa at sourceware dot org>
- Date: Mon, 22 Sep 2014 11:22:29 -0500
- Subject: Re: Strange ClassCastException
- Authentication-results: sourceware.org; auth=none
- References: <8761ghwobe dot fsf at vostro1520 dot AFP-HOME> <541FC785 dot 9060800 at bothner dot com>
- User-mail-address: alcides dot fp at gmail dot com
Hi Per:
Thank you very much for your help and your quick response.
My little program is working well now. :-)
Greetings.
--
Alcides Flores Pineda
On Mon, Sep 22 2014, Per Bothner wrote:
> On 09/20/2014 10:11 PM, Alcides Flores Pineda wrote:
>> Here is the code just as I typed it in the REPL (and saved it in a file too):
>>
>>> #|kawa:1|# (define (circle-area radius) (* java.lang.Math:PI (expt radius 2)))
>>
>> And I got this result/exception when calling it (or running the file
>> with kawa -f):
>>
>>> #|kawa:2|# (circle-area 3)
>>> java.lang.ClassCastException: java.lang.Double cannot be cast to gnu.math.Numeric
>
> I checked in a fix for this. I also checked in a testcase based on your report.
>
> I'm also thinking about some tweaks to code-generation that avoid this problem,
> but the current check-in should be ok for now.