Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 04 Apr 2013 13:48:13 -0500 Date: Thu, 04 Apr 2013 19:48:10 +0100 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Usefulness of "final" (Was: Re: Inserting In a List) References: <19un43xj77bua.vw45l4e2wshi.dlg@40tude.net> <515cabb2$0$32111$14726298@news.sunsite.dk> <515cc192$0$32109$14726298@news.sunsite.dk> <515cc46b$0$32111$14726298@news.sunsite.dk> <515cc8e5$0$32109$14726298@news.sunsite.dk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 40 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-i8p/+856exWt3e2FhvPqg+ymtF+B4VhYBoaalD1WHHGhWVKw0oBTCuWQqibmJQRZ1WqmDBgSl/961tY!LwII5GncpZ2ZlN4y6qvvVyzlY0Fp+8qpRZvPR1ifEGRGYQRyeCq8lOTGZUlO5ZSaP9UA82CYwbA= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3703 Xref: csiph.com comp.lang.java.programmer:23313 On 04/04/13 18:44, Robert Klemme wrote: > On 04.04.2013 18:47, markspace wrote: >> On 4/4/2013 5:27 AM, Eric Sosman wrote: >>> Perhaps the widely-held >>> ideas about "immutable" are not those you share.) >> >> Well, if we're all using different definitions of a term, talking about >> it is pretty tough. Immutability is defined correctly in the JLS, at >> least for Java. I think it would be most useful to use that term. > > If it was I'd guess the terms "mutable" or "immutable" would surely show > up in the index, but they don't - opposed to "final" which has several > entries: > > http://docs.oracle.com/javase/specs/jls/se7/html/jls-0-index.html > > No, the JLS does not define "immutable" - it just mentions it. The JLS does not (presumably) define immutable for the same reason it does not define singleton or aardvark or any other implementation vehicle. If there were an immutable modifier in the same way that there is final modifier then it would be a feature of the language but there isn't so it's not. Mutability is an implementation concept in the same way that deque is an implementation concept. the final modifier can be useful when implementing an immutable component but final and immutable are not the same thing at all. A final *variable* is immutable but an immutable component is not necessarily final. There's a brief discussion of immutability here http://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html But I'm sure others have already pointed this out. I'll get my coat :-) lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun