This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Problem defining a class implementing an interface nested in a class
On 02/28/2011 02:15 AM, Colin Fleming wrote:
Note that in Scheme in general and Kawa in particular the '.' is part of a name, and not an operator. (Likewise in XML.)
Kawa uses ':' instead for most of the places where Java uses '.'. The name javax.swing.text.AbstractDocument is actually a single
identifier, not a compound expression.
This is something I've been curious about, actually - isn't the same
true of ':'? According to R5RS it should be valid as a start or
subsequent character.
True. If Kawa can differ from RnRS in its treatment of ':' why not '.'?
My reasoning is that ':' is treated a special "operator" in more
contexts than '.' is. Examples include XML/HTML names (such as
element and attribute names), file names, and URIs/URLs. OTOH
Scheme libraries tend to use ':' as a pseudo namespace delimiter
often, so Kawa has some hacks to support those.
So as I understand it:
(geom:translate 0 0)
has geom:translate as a single identifier.
Nope - the ':' is treated as a special operator.
Also I think I should also
be able to do (according to something I'm sure I saw in the doc but
now can't find):
Perhaps http://www.gnu.org/software/kawa/PathExpressions.html
Now that I have a new "Syntax" section in the manual, I have a
place in the Kawa manual where I can put an updated specification of
colon notation. I will do that.
((geom:translate 0 0):translate 5 1)
How is the :translate part handled? Are these forms treated as special
by Kawa internally?
foo:bar
is read as:
($lookup$ foo (quasiquote bar))
(The use of quasi-quote allows use of the comma unquote operator.)
The $lookup$ function is implemented by gnu.kawa.functions.GetNamedPart.
There are some hacks in the quote operator that converts 'foo:bar
to a simple symbol, so (eq? 'foo:bar '|foo:bar|).
Are spaces allowed around the ':' characters?
No. Otherwise it would conflict with the keyword syntax.
The colon character is somewhat overused in Kawa ...
--
--Per Bothner
per@bothner.com http://per.bothner.com/