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: How call class (not object) method?


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/


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