[patch] 6746458 support for exotic identifiers (identifier superquote)

John Rose John.Rose at Sun.COM
Tue Sep 9 20:19:23 PDT 2008


On Sep 9, 2008, at 6:12 PM, Per Bothner wrote:

> Saying that you can use #"+" but not #"/" seems hard to justify.

Except for the fact that javac is a compiler for the JVM.  That makes  
it much easier to justify.

And the mangling I proposed (or any similar mangling) is very  
lightweight and can even be intuitive (kind of like learning a regex  
language).

For Scheme, a exotically-named division method would be named #"\\|"  
in Java code instead of /.  Allow me to be the first to retch.  Yes,  
there are three layers of quoting there, but it's still passably  
legible to humans and easy to emit by source code generators.

BTW, regarding \|...|, we certainly could define a new kind of  
delimited string-like token, but the virtue of reusing double quotes  
is that tools (like colorizing editors) either DTRT out of the box,  
or are easy to adapt, by reusing pre-existing scanner rules.

-- John



More information about the compiler-dev mailing list