This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: extended "colon notation"
- From: Per Bothner <per at bothner dot com>
- To: kawa at sources dot redhat dot com
- Date: Wed, 03 Aug 2005 21:08:35 -0700
- Subject: Re: extended "colon notation"
- References: <42EAAD30.5030509@bothner.com>
You can now access instance methods using this short-hand:
(*:MNAME instance arg ...)
;; same as (invoke instance 'MNAME arg ...)
You can now also access fields using colon-dot-notation:
(TYPE:.FNAME)
;; same as (static-field TYPE 'FNAME)
(*:.FNAME instance)
;; same as (field 'FNAME instance)
(TYPE:.FNAME instance)
;; same as (*:.FNAME (as instance TYPE))
These all work with set! - for example:
(set! (*:.FIELD-NAME X) VAL)
TYPE can be one of:
- a namespace prefix bound to a namespace uri "class:CLASSNAME"
- a namespace prefix bound to a <CLASSNAME> name, which can be
a fully-qualified class name or a locally-declared class, or an alias
(which might be an imported class).
- a fully qualified CLASSNAME, as in CLASSNAME:MEMBER
- a <CLASSNAME> variable, for example: (<list>:list3 11 12 13).
--
--Per Bothner
per@bothner.com http://per.bothner.com/