Nice TWiki > Dev > UserManualOmissions (r1.22) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Dev . { Changes | Index | Search | Go }
These are aspects of the language that are not covered by the User Manual, but that should be.

Aspects that should be updated:

Things that we can't do yet:

Things that have now been done:

Important

I'll be making another round of changes to the manual in the next few weeks, and I'm going to be looking at this page first when I decide what needs coverage. So if there's something important missing from the manual, please note it on this page ASAP. Your help means a better manual, and happier users.

Thanks.

-- BrynKeller - 01 Oct 2003


The documentation for || with nulls should explain the interaction between || and autoboxing. In particular, 1 || 2 seems to be the same as new Integer(1) || new Integer(2). (The compiler should also be able to detected the dead code in this situation: new Integer(1) can never be null, so new Integer(2) is never executed.) Also, the documentation should explain the way that || coexists with the nullness checking for fields as demonstrated at the end of this example:

    class A { ?Integer n; }

    void main(String [] args) {
        println(0 || 1);
        println(2 || 1);

        println(null           || new Integer(1));
        println(new Integer(2) || new Integer(1));

        let a1 = new A(n: null),
            a2 = new A(n: new Integer(2));

        println(a1.n || new Integer(1));
        println(a2.n || new Integer(1));

        Integer n1 = a2.n || new Integer(1);
        println(n1);

        // NOT equivalent to
        //    n2 = a2.n || new Integer(1);
        // error:
        //    The value if(`!=`(a2.n(), null))
        //                 a2.n()
        //              else
        //                 new Integer(1)
        //    cannot be assigned to n2 because it might be null.
        //
        // Integer n2 = a2.n != null ? a2.n : new Integer(1);
        // println(n2);

        // equivalent to
        //    n3 = a2.n || new Integer(1);
        ?Integer temp = a2.n;
        Integer n3 = temp != null ? temp : new Integer(1);

        println(n3);
    }
Output:
    0
    2
    1
    2
    1
    2
    2
    2

Topic UserManualOmissions . { Edit | Attach | Ref-By | Printable | Diffs | r1.43 | > | r1.42 | > | r1.41 | More }
Revision r1.22 - 29 Jan 2004 - 09:59 GMT - BrianSmith
Parents: WebHome
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.