This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: How call class (not object) method?
- From: Per Bothner <per at bothner dot com>
- To: Yaroslav Kavenchuk <kavenchuk at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Thu, 13 Dec 2007 09:10:52 -0800
- Subject: Re: How call class (not object) method?
- References: <47615C58.8010400@gmail.com>
Yaroslav Kavenchuk wrote:
#|kawa:13|# (kawa.standard.Scheme:class)
kawa.standard.Scheme@1fcf0ce
Leave out the parentheses:
#|kawa:13|# kawa.standard.Scheme:class
class kawa.standard.Scheme
If you add the parentheses you're asking to call the object as
a function - which Kawa does by constructing an instance of the class.
#|kawa:14|# ((kawa.standard.Scheme:class):getProtectionDomain)
The Kawa syntax
(CLASS:NAME)
in failing because Kawa is looking for a static method NAME in CLASS.
I'm not sure you can so what you want with colon notation.
Instead, use invoke:
#|kawa:18|# (invoke kawa.standard.Scheme:class 'getProtectionDomain)
ProtectionDomain (file:/home/bothner/Kawa/work3/ <no signer certificates>)
sun.misc.Launcher$AppClassLoader@13f5d07
<no principals>
java.security.Permissions@9ced8e (
(java.lang.RuntimePermission exitVM)
(java.io.FilePermission /home/bothner/Kawa/work3/- read)
)
and :class isn't needed since the "value" of kawa.standard.Scheme
as an identifier is the class:
#|kawa:19|# (invoke kawa.standard.Scheme 'getProtectionDomain)
ProtectionDomain (file:/home/bothner/Kawa/work3/ <no signer certificates>)
sun.misc.Launcher$AppClassLoader@13f5d07
<no principals>
java.security.Permissions@9ced8e (
(java.lang.RuntimePermission exitVM)
(java.io.FilePermission /home/bothner/Kawa/work3/- read)
)
--
--Per Bothner
per@bothner.com http://per.bothner.com/