Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: The Assignment Principle Date: Mon, 27 Jan 2014 18:50:37 +0100 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net daGf8ZnHMqJU4VehWLfhXgB9hGXs0UxWtuZEU5WIohexKoVQE= Cancel-Lock: sha1:4rz1yigdzTvgyU6Czdu9N1JqwTk= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:27408 On 26.01.2014 23:27, markspace wrote: > Math.random() is kind of an exception, as well as NaN, which has its own > semantics for comparisons. > > It's fair to point out that objects have states, and method invocation > often returns different values based on their internal state. > > InputStream in = ... > v = in.read(); > > Is going to return a different value for each invocation, generally > speaking. That's why I would disagree calling Math.random() an exception. So basically the original quoted principle can only reasonably apply to values (object references and primitive type values). And there NaN is really an exception. Kind regards robert