This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: define-alias NOT working
- From: Per Bothner <per at bothner dot com>
- To: Alcides Flores Pineda <alcides dot fp at gmail dot com>, Kawa Mailing List <kawa at sourceware dot org>
- Date: Sat, 04 Apr 2015 19:15:49 -0700
- Subject: Re: define-alias NOT working
- Authentication-results: sourceware.org; auth=none
- References: <552069DD dot 5010409 at gmail dot com>
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/