ARM syntax and new keywords

Ted Neward ted at tedneward.com
Thu Dec 3 02:34:02 PST 2009


Actually, the exotic identifiers syntax has a loophole that probably should
be closed:

class #"java\\lang\\Object" // compiles into <targetdir>/java/lang/Object
{
}

Ted Neward
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing
http://www.tedneward.com

> -----Original Message-----
> From: coin-dev-bounces at openjdk.java.net [mailto:coin-dev-
> bounces at openjdk.java.net] On Behalf Of Neal Gafter
> Sent: Thursday, November 26, 2009 12:49 PM
> To: David Goodenough
> Cc: coin-dev at openjdk.java.net
> Subject: Re: ARM syntax and new keywords
> 
> On Thu, Nov 26, 2009 at 10:30 AM, David Goodenough <
> david.goodenough at linkchoose.co.uk> wrote:
> 
> > On Thursday 26 November 2009, Neal Gafter wrote:
> > > Now that jdk7 will include a syntax for using names that are
> otherwise
> > > keywords (the syntax is #"name"), the backward-compatibility
> breakage of
> > > adding a new keyword is much less severe.  Also, context-sensitive
> > keywords
> > > are a true-and-tried technique, just not used yet in Java.
> > >
> > I hope that the # operator will be available for both methods and
> fields.
> > This was discussed early on in the Coin process, in my lightweight
> > properties
> > proposal.  It is really the only bit of that proposal that is needed,
> the
> > rest
> > can be done in other ways.
> >
> 
> This has nothing to do with closures (there is a separate email list
> for
> that anyway).  The #"name" syntax was added to give a way of using
> "exotic"
> identifiers that would otherwise be disallowed.  For example, if you
> have a
> method pre jdk7
> 
>   int foobar(int x) { return x + 1; }
> 
> and then we add a keyword "foobar" to the language in jdk7, you can
> still
> use the identifier "foobar" by modifying the source as following
> 
>   int #"foobar"(int x) { return x + 1; }
> 
> This is even possible for package names, though a bit awkward
> 
>   package #"foobar";
> 
> Cheers,
> Neal




More information about the coin-dev mailing list