Nice TWiki > Dev > FeatureProposals > AddingConstness TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Dev . { Changes | Index | Search | Go }
On a longer term(post 1.0) Nice might get a const keyword. Anyone who's is interested in writing a proposal should look at this proposal for java: http://david.tribble.com/text/javaconst.html

It's a very good starting point in my opinion.

An extension to Java exists that add constness: http://pag.lcs.mit.edu/constjava/

-- ArjanB

How would this be different from let?

-- IsaacGouy - 17 Sep 2003

When using let or final in java you can't change the reference. And const is like in c++ that the object that is referenced may not be changed.

-- ArjanB

I never much liked "const" as it exists in C++. The problem is that an object might appear to be mutable or immuable depending on where you are in the code. So a "const" object might change due to action somewhere else in the program.

Much better to have true immutable objects. Perhaps mutable and immutable versions of the same type, similar to !T and ?T.

Final instance variables in Java provide finer control since you can make an object partially immutable.

-- BrianSlesinsky - 21 Nov 2003

Topic AddingConstness . { Edit | Attach | Ref-By | Printable | Diffs | r1.4 | > | r1.3 | > | r1.2 | More }
Revision r1.4 - 21 Nov 2003 - 07:40 GMT - BrianSlesinsky
Parents: WebHome > FeatureProposals
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.