Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: enhance an array's static type by a lower length-bound. Date: Thu, 18 Aug 2011 10:30:04 -0500 Organization: A noiseless patient Spider Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 18 Aug 2011 15:30:15 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="WpcHJSul77m+zlbR9GVqkA"; logging-data="4386"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RuQdGBe7Y9mxlIWmw/C4gnbvjrKREt3Y=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 In-Reply-To: Cancel-Lock: sha1:/zCqd1ZpOZTARf+tEqq8iCqtRCI= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7219 On 8/18/2011 8:14 AM, Andreas Leitgeb wrote: > Joshua Cranmer wrote: >> On 8/17/2011 10:04 AM, Andreas Leitgeb wrote: >>> I believe such a change would be source-compatible, but might require >>> some severe changes at the bytecode/class-file-format level, to allow >>> to specify such a lower bound in a type signature. Such a change should >>> be possible in a way, that old class-files can still be used. e.g.: >>> get9th:(]10I)I (currently without bounds: get9th:([I)I ) >> You could do it by adding a few new annotations, > > I must admit, that I've so far mostly ignored Annotations for my > tasks. When you write "adding a few annotations", do you just mean > adding certain standard annotations to the respective places, or did > you mean defining a custom Annotation and write some code for a > compiler-plugin that would then deal with one's new Annotations? I was actually referring to class file annotations, not Java annotations. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth