I suggested a language extension to Java for just this problem: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519124
That allowed keywords to be escaped by surrounding them with an underscore, e.g. the Java keyword class could be escaped via _class_. You could add a similar escape mechanism to Fan. Similarly Scala uses back quote ` for its escape character. On Apr 20, 7:38 am, John Rose <[EMAIL PROTECTED]> wrote: > On Apr 19, 2008, at 1:30 PM, Brian Frank wrote: > > > One thing I really wish Java would > > solve is the keyword problem - for example if a Fan class declared a > > method called "import", then it wouldn't be usable in Java. C# solves > > with the @ symbol. > > There are a few parts to that: > > 0. The community has to decide to support some specific convention of > symbolic freedom that VMs and languages will support, regardless of > language-specific and VM-specific restrictions. I think the default > answer has to be Lisp's, which is any string can be a name, with > social pressure against abuses. > > 1. The JVM has to provide a way around its own mild but peculiar > restrictions against characters like slash and semicolon. (It is > unreasonable to deny Scheme a symbol named '/' just because the JVM > has another internal use for that character.) > > Here is the best way I know of to relax the JVM restrictions; it > works today:http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm > > 2,3,4,... Each language has to admit the existence of spellings from > other languages by supporting an escape syntax for exotic names. For > example, Groovy supports foo.'bar!', where the thing after the dot is > lexically a string but syntactically a name. It's a one-line hack in > the parser. I think Java should do something similar with single > quotes and/or backslashes and be done with it. Java has a special > reason to do this, because it will be the "systems programming > language" on the JVM for the foreseeable future. > > -- John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---