From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Tally Date: Thu, 16 Jan 2020 23:00:58 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <3c6f1486-293d-4eb5-a379-279b108248d8@googlegroups.com> <4967a95b-3d79-4a5b-a30d-0f04f00ebbc4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 16 Jan 2020 22:00:58 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="114184e09e4013b433386dd0b93c16e6"; logging-data="30944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Uto6tZpWtTXmPyqYiOrWXz6gsbuxpIbM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 Cancel-Lock: sha1:FMv32Y9ldj/tA00Ito4xqHJh+Ps= In-Reply-To: <4967a95b-3d79-4a5b-a30d-0f04f00ebbc4@googlegroups.com> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57853 Date: 2020-01-16T23:00:58+01:00 List-Id: On 1/16/20 4:35 PM, Brad Moore wrote: > > Counts : Count_Maps.Map > := [for I in Input'Range > when (for all J in Input'First .. I - 1 => Input (I) /= Input (J)) > use I => 0]; I think you want use Input (I) => 0 here (and further on). I can figure out what this does, but I wouldn't call it clear. > Counts : constant Count_Maps.Map > := [for I in Input'Range > when (for all J in Input'First .. I - 1 => Input (I) /= Input (J)) > use I => > [for K in Input'Range when Input (K) = Input (I)) => 1] > 'Reduce("+", 0)]; This is getting close to write-only code. -- Jeff Carter "I'm a lumberjack and I'm OK." Monty Python's Flying Circus 54