From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115710 invoked by alias); 1 Apr 2017 16:28:50 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 115691 invoked by uid 89); 1 Apr 2017 16:28:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Caused X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Apr 2017 16:28:48 +0000 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cuLtO-0000UN-Vu; Sat, 01 Apr 2017 18:28:47 +0200 Received: from 70-36-239-167.dsl.dynamic.fusionbroadband.com ([70.36.239.167] helo=localhost.localdomain) by mailfront10.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1cuLtD-0005VG-ER; Sat, 01 Apr 2017 18:28:35 +0200 Subject: Re: Help, writing kawa equivalent of java program To: Vasantha Ganesh , kawa@sourceware.org References: From: Per Bothner Message-ID: <58919df1-afe7-ae3b-0fdc-bb428c8ba3ed@bothner.com> Date: Sat, 01 Apr 2017 16:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00007.txt.bz2 On 04/01/2017 08:54 AM, Vasantha Ganesh wrote: > > and this Kawa program: > > (define-simple-class kittens () > (make-interface #t) > (a::long)) > > (display kittens:class) > > I think both are equivalent, but kawa seems to think that I'm doing a > type cast and throws this error message: > > Argument #1 'class kittens' to 'gnu.bytecode.Type.getReflectClass()' > has wrong type (class) (java.lang.Class cannot be cast to > gnu.bytecode.Type) > at not_working.run(not_working.scm:5) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:317) > at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42) > at gnu.expr.CompiledModule.evalModule(CompiledModule.java:61) > at kawa.Shell.runFile(Shell.java:538) > at kawa.Shell.runFileOrClass(Shell.java:447) > at kawa.repl.main(repl.java:881) > Caused by: java.lang.ClassCastException: java.lang.Class cannot be > cast to gnu.bytecode.Type > ... 7 more That looks like a bug. I'll take a look. It does work if you use the -f flag: kawa -f /tmp/not_working.scm class kittens -- --Per Bothner per@bothner.com http://per.bothner.com/