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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:4047:: with SMTP id n68mr36631636qka.258.1579229499736; Thu, 16 Jan 2020 18:51:39 -0800 (PST) X-Received: by 2002:a9d:6544:: with SMTP id q4mr4645826otl.194.1579229499494; Thu, 16 Jan 2020 18:51:39 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!g89no4776682qtd.0!news-out.google.com!w29ni1433qtc.0!nntp.google.com!g89no4776668qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 16 Jan 2020 18:51:39 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=50.66.161.135; posting-account=lzqe5AoAAADHhp_gregSufVhvwu22fBS NNTP-Posting-Host: 50.66.161.135 References: <3c6f1486-293d-4eb5-a379-279b108248d8@googlegroups.com> <4967a95b-3d79-4a5b-a30d-0f04f00ebbc4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Tally From: Brad Moore Injection-Date: Fri, 17 Jan 2020 02:51:39 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57856 Date: 2020-01-16T18:51:39-08:00 List-Id: On Thursday, January 16, 2020 at 3:25:50 PM UTC-7, Simon Wright wrote: > "Jeffrey R. Carter" writes: > > >> 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. > > Already there. That'll be the challenge, I think. With more tools (and new ones) to work with, one hopes people will end up choosing the right tool for the job. Some of the new tools are powerful, and there might be a tendency to want to use them, but a simpler tool can get the job done faster sometimes. This example feels like using a big new table saw to slice bread, when a good 'ol bread knife can get it done faster and better. Note that the simple loop accomplishes the task with a single pass through the date. The monster expression has 3 levels of nested loops, so hard to imagine it would beat the simple loop. Brad