This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Syntax to access method and field of instance
On 10/16/2011 05:49 PM, Taylor Venable wrote:
Hi there; it seems that you can use the following (very useful) syntax
to access a method or field of an instance:
(some-obj:toString) = (*:toString some-obj)
some-obj:field = (*:.field some-obj)
I found that this was possible by looking through the source code. But
it doesn't seem to be mentioned on either of the relevant manual pages
[1] or [2]. Unless I've missed something, which is completely
possible. Is it safe to use this syntax, and maybe just a gap in the
documentation? Or is it prone to change in the future? Thanks!
It's safe to use the syntax - it's what I recommend these days.
I apologize for the poor documentation. There is an old write-up here:
http://www.gnu.org/s/kawa/PathExpressions.html
The non-released SVN version of the manual does say a bit about it.
Go to the doc directory; make info; and looking for the "Colon notation"
sub-node of the "Syntax" chapter.
However, even the CVS version of the manual needs work when it
comes to the sections you linked to. I'll see what I can do.
This will be part of the on-line manual at next release. Of course
this has dragged on a bit; I guess it could come any time. but I just
started working on patterns, and it would be nice to get that in.
--
--Per Bothner
per@bothner.com http://per.bothner.com/