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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Mon, 30 Apr 2018 21:26:30 -0700 Organization: A noiseless patient Spider Message-ID: <877eoom26h.fsf@nightsong.com> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="d740b49da12eaabd4c203ceddc63754d"; logging-data="20200"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vroZvel66VLGknD253TsA" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:/6vjZ61SEQhvHe3dYA6wrElxYKU= sha1:uieg3iEX6IU7mRaZO8GBGDCxvAg= Xref: reader02.eternal-september.org comp.lang.ada:51866 Date: 2018-04-30T21:26:30-07:00 List-Id: "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. In functional style you can get rid of the loop and write something like "new_array = map(square, old_array)". This article discusses FP style and why you might want to use it: https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf It's from 1984 and its code examples are in a language called Miranda that nobody uses any more, but it was a forerunner of Haskell, and the Miranda code could be translated straightforwardly and end up looking cleaner.