PROPOSAL: Language Escape Operator
brucechapman at paradise.net.nz
Fri Mar 27 00:25:07 PDT 2009
rssh at gradsoft.com.ua wrote:
> 1. But feature without 'semantic' of use is quite useless. I. e. until
> processing of 'escaped part' in java program is not standardized, I will
> be able redistribute and show such code only with knowledge about extra
> tools and how they are applied.
"Code" which uses the escaped part is not Java code. It is a mix of
java code and something else. It has no meaning as a purely java program
- thus it would at least be immoral to use ".java" file extension. It
has meaning only in the context of some external tool, or externally
defined mechanism. In some ways it makes no more sense to describe the
semantics of the escaped part than it does to describe the semantics of
a String literal's content.
In the particular proof of concept I have used as an example, the escape
part is only visible when looking at the IDE, it is a complex series of
linked folds. To distribute this in a form where the escape operator was
visible you would need something like a screen shot image - in which
case it would be obvious that you were not looking at complete code. The
source file in that case would not contain the escape operator, just
pure java code, and distributing it would be no different from when the
tool was not being used.
> I.e. to be practical, at least process of defining and applying such
> extra tools must be described somewhere. (something like call of
> annotation processing interface from compiler)
The "semantics of use" with respect to the java language and compiler
are defined in the proposal. It is quite simply a compiler error.
How tools choose to use this is beyond the scope of the java language
specification, but for an example see the referenced proof of concept. I
very deliberately have absolutely no intention of dictating how such a
feature should be used by tools outside of the language. I merely wish
to reserve the opportunity for them to do something - anything if it is
> 2. Yet one linked 'bug' in JLS: Behaviour of java compiler is not defined
> at all. (Annotation processing is described in man page, not in JLS
> itself, so, strictly it's not part of Java language)
True, it is not part of the language but it is a part of the java
platform because it is described in javax.annotation.processing package
and the platform documentation for the javac compiler says that it is an
If you are having trouble understanding - please see my previous post
(approx 4 hours earlier) for links to some more background material. I
am aware that I am "going meta" somewhat here and it might be difficult
to understand. Believe me I have struggled to find ways to explain it.
If I need to struggle harder, please ask and I'll do my best.
- SNIP -
More information about the coin-dev