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!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Tue, 1 May 2018 08:43:49 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.com> <87po2la2qt.fsf@nightsong.com> <87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com> <16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com> <87o9i2pkcr.fsf@nightsong.com> <87bme2oy91.fsf@nightsong.com> <877eoom26h.fsf@nightsong.com> NNTP-Posting-Host: kQkuQcRDy1QFvWpyB1foYw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:51867 Date: 2018-05-01T08:43:49+02:00 List-Id: On 2018-05-01 06:26, Paul Rubin wrote: > "Randy Brukardt" writes: >> Futzing with "finicky control structures" (what the heck is that >> anyway, the only control structures Ada has are the normal ones like >> if and case) > > Well there are also loops etc. If you want to make a new array whose > elements are the squares of all the elements of an old array, you end up > writing a loop. But I don't want it. There is no practical need in array operations using arrays as a whole. > In functional style you can get rid of the loop and > write something like "new_array = map(square, old_array)". In Ada and in any other language, honestly, if I could, I would define an ADT with the corresponding algebra if I needed it: type Vector is array (...) of ...; function "*" (Left, Right : Vector) return Vector; The "squaring" would be old_array * old_array. Or even old_array ** 2. Such manipulation must have some sense. That differentiates software engineering from coding mentioned in this discussion. Manipulation on data structures do not come from nowhere, for its own sake. There is the problem space's logic and structures the program artifacts implement. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de