From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26639 invoked by alias); 5 Apr 2015 02:16:18 -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 26628 invoked by uid 89); 5 Apr 2015 02:16:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Sun, 05 Apr 2015 02:16:13 +0000 Received: from [10.9.9.209] (helo=mailfront04.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1Yea6a-0003tQ-Ba; Sun, 05 Apr 2015 04:16:08 +0200 Received: from 70-36-239-115.dsl.dynamic.fusionbroadband.com ([70.36.239.115] helo=toshie.bothner.com) by mailfront04.runbox.com with esmtpsa (uid:757155 ) (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) id 1Yea6M-0007Da-Bx; Sun, 05 Apr 2015 04:15:54 +0200 Message-ID: <55209AD5.3050604@bothner.com> Date: Sun, 05 Apr 2015 02:16:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alcides Flores Pineda , Kawa Mailing List Subject: Re: define-alias NOT working References: <552069DD.5010409@gmail.com> In-Reply-To: <552069DD.5010409@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-q2/txt/msg00005.txt.bz2 On 04/04/2015 03:46 PM, Alcides Flores Pineda wrote: > (define-alias showMsgDlg javax.swing.JOptionPane:showMessageDialog) > > (showMsgDlg #!null "Hello everybody from Kawa!") > > > That used to work pretty well in Kawa 1.14, is now broken.. > > $ java -cp kawa-2.0.1.jar kawa.repl > #|kawa:1|# (define-alias showMsgDlg javax.swing.JOptionPane:showMessageDialog) > java.lang.NullPointerException > at kawa.standard.location.rewriteApply(location.java:96) I checked in a fix for this. By the way: Kawa isn't able to resolve the call to showMsgDlg to a specific method, so it ends up doing runtime reflection. It would be nice to fix this, but as an alternative you might consider using a macro: (define-syntax showMsgDlg (syntax-rules () ((_ . args) (javax.swing.JOptionPane:showMessageDialog . args)))) -- --Per Bothner per@bothner.com http://per.bothner.com/