Valid characters in a module name
Peter Levart
peter.levart at gmail.com
Fri Jan 6 22:45:57 UTC 2017
Hi Ess,
On 01/06/2017 05:27 AM, Ess Kay wrote:
>> chances of meeting a module-info.class with funky module names is low
> When I raised the initial question, I had no idea that the Java verifier
> had been changed (with Java 6?) to allow "funky" package, class, field and
> method names. Somehow that change passed right under the radar. Yes - a
> possible option would be to simply ignore the broad character range allowed
> by the JVM specification and trust that in practice no one would actually
> use the usual characters in package, class, field, method or module names.
> A downside to that option is that we will no longer be able to say to our
> users that we fully support the JVM specification which in some cases can
> be a problem. Anyway, I guess it is time to accept the overwhelming inertia
> of the status quo and move on to the next problem.
If I remember correctly, there was a crazy proposal in the past to
specify a syntax for arbitrary symbol names in Java. It went roughly like:
@"the syntax of Java string in here"
So you could write code like:
public class @"What a wonderful world!" {
public static void @"Let's party..."() {
}
}
//
@"What a wonderful world!".@"Let's party..."();
You could adopt this in your tool, what do you think?
Regards, Peter
More information about the jigsaw-dev
mailing list