quid.txt
author jrose
Fri Sep 12 20:17:34 2008 -0700 (4 years ago)
changeset 5 d73ab86abbe1
parent 47d810bbd3a83
permissions -rw-r--r--
quid: fix typos
        1 6746458: writing libraries in Java for non-Java languages requires support for exotic identifiers
        2 Summary: token syntax (currently non-standard) for introducing exotic identifiers
        3 
        4 javac needs to support library development for non-Java langauges
        5 
        6 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6746458
        7 
        8 Features:
        9 - hash mark followed immediately by string literal creates an identifier of the given spelling
       10 - no other processing or interpretation is given to the identifier
       11 - #"foo" is indistinguishable from foo, if foo is a normal, non-keyword identifier
       12 - rejects exotic identifiers which may run into JVM limitations
       13 - rejects empty string and any string with one of "/.;<>["
       14 - user must mangle invalid symbols; see http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm
       15 
       16 Examples from the unit test:
       17     class #"*86" {
       18         String #"555-1212"() { return "[*86.555-1212]"; }
       19     }
       20     class #"int" extends Number {
       21         final int #"int";
       22         #"int"(int #"int") {
       23             this.#"int" = #"int";
       24         }
       25         static #"int" valueOf(int #"int") {
       26             return new #"int"(#"int");
       27         }
       28         public int intValue() { return #"int"; }
       29         public long longValue() { return #"int"; }
       30         public float floatValue() { return #"int"; }
       31         public double doubleValue() { return #"int"; }
       32         public String toString() { return String.valueOf(#"int"); }
       33     }
       34 
       35 Authors:
       36 - John Rose (Sun)
       37 
       38 Tests:
       39 - unit tests test/tools/javac/quid/*
       40 
       41 Incremental testing:
       42 This does not require a full JDK build.
       43 
       44 $ cd .../langtools
       45 $ hg qpush quid.patch
       46 $ (cd make; make)
       47 $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java
       48 $ java -version  # should print 1.6 or later
       49 $ java -cp dist quid.QuotedIdent  # should print OK
       50 $ ./dist/bootstrap/bin/javac -d dist -cp dist test/tools/javac/quid/QuotedIdent2.java
       51 $ java -cp dist quid.QuotedIdent2  # should print OK