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: extended "colon notation"


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/


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