This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Using <java.lang.Class>:forName with define-simple-class
- From: Per Bothner <per at bothner dot com>
- To: kawa at sourceware dot org
- Date: Fri, 07 May 2010 14:37:33 -0700
- Subject: Re: Using <java.lang.Class>:forName with define-simple-class
- References: <C809F0FA.24A25%lexaay@gmail.com>
On 05/07/2010 01:31 AM, alex mitchell wrote:
I'm trying to get a kawa-based application to be aware of MacOS application
events such as Apple-Q, and would like to avoid having to change my source
code when compiling on other platforms.
I think a good way to handle this would be to extend cond-expand.
Probably in a way so that it can evaluate syntax-transformers, like:
(define-simple-class <foo> ((cond-expand ((is-mac) ....) (else
#|none|#)) ) ...)
where is-mac is a syntax-case macro, which checks
(java.lang.System:getProperty "os.version")
at macro-expansion time.
There may also be some work needed so that define-simple-class
macro-expands the super-class list, since then you can put
a cond-expand there.
Patches welcome ...
Instead, I've tried this:
(define-simple-class<my-application-adapter> ((<java.lang.Class>:forName
"com.apple.eawt.ApplicationAdapter"))
...)
However, I get an "invalid super type" compile-time error.
Yep - the super-type-list needs to be resolved at compile-time.
--
--Per Bothner
per@bothner.com http://per.bothner.com/