Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Java blunders Date: Wed, 23 Jul 2014 08:55:14 -0400 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <7yf7pbm3gs9r$.1kq8rlnls3wt5$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 23 Jul 2014 12:55:18 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="19471"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18el7+GbSZV+FaieQ6eELAn" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:SPsVy4iMUn5PxTWRd0Ba8KRGchU= Xref: csiph.com comp.lang.java.programmer:29229 On 7/23/2014 8:32 AM, Martin Gregorie wrote: > On Wed, 23 Jul 2014 04:23:44 -0700, Roedy Green wrote: > >> You would not make byte unsigned. It is far too late for that. You would >> add a ubyte unsigned type. >> > Or introduce an 'unsigned' qualifier that would only be valid for numeric > primitives. Its not a big change to the language because Java already > uses qualifiers, e.g. static and final. I'd prefer this to introducing a > new primitive type. ... except it *would* be a new primitive type, just spelled with two words instead of one: - The `unsigned x' could represent values a plain `x' could not, and vice versa, - Arithmetic on identical `unsigned x' and `x' values could yield different results, - There would need to be new rules for mixed-mode arithmetic (for example, what is `-6 % (unsigned int) 3'?), or a prohibition against such expressions. Different values, different behavior, different rules -> different types. -- esosman@comcast-dot-net.invalid