Closed GoogleCodeExporter closed 9 years ago
I've made progress on this one. It now seems possible to safely use Java
keywords as
identifiers, state names, and field names. The following code works
("protected",
"synchronized", "abstract", and "continue" are Java keywords that are not Plaid
keywords or stdlib members.)
state protected {
var abstract = 5;
method continue() {
java.lang.System.out.println("continue");
}
}
method main() {
var synchronized = new protected with {abstract = 4;};
java.lang.System.out.println(synchronized.abstract);
synchronized.continue();
}
However, attempts to add objects to the stdlib with the same name as a Java
keyword
(notable examples: true and false) still fail, with a
java.lang.NoClassDefFoundError.
Original comment by matta...@gmail.com
on 4 Jun 2010 at 8:21
As we found out on Friday, this does only work on my laptop (64-bit Linux,
Eclipse
3.5.2, java 1.6.0_20 64-bit) -- for whatever reason. We should probably resolve
this
if we want to put a downloadable package on the site. Alternatively, we could
also
should some other name for true/false for the release.
Original comment by manuelmohr@gmail.com
on 5 Jun 2010 at 4:29
t and f would work. Ideally we'd like to fix this before the release, but that
might not happen.
Original comment by matta...@gmail.com
on 7 Jun 2010 at 8:20
This is inaccurate. The real bug prevents two identifiers with the same name,
differing only by case, from being in the same package. As the bug is in the
JRE, we cannot fix this bug. We shall have to work around it but putting True
and true in different packages in stdlib.
Original comment by matta...@gmail.com
on 14 Jun 2010 at 2:40
Original issue reported on code.google.com by
matta...@gmail.com
on 3 Jun 2010 at 10:12