This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: define-alias NOT working




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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]