From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: moi Newsgroups: comp.lang.ada Subject: Re: project euler 26 Date: Tue, 5 Sep 2023 18:35:10 +0100 Message-ID: References: <878r9mudvj.fsf@bsb.me.uk> <87a5u1u1yv.fsf@bsb.me.uk> <8734ztttpc.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net PdsdQ5qTwY0Jd2/GTkGlYQrJ9ZZT90ditJyoKwNDv3H1OYwzh7 Cancel-Lock: sha1:35KoZUmyuebYAus6/ilDLTkhpCk= sha256:+sTsU/RUO+FoZxrEaP6+bqWxQbGqyGABLviiC4lhakM= User-Agent: Mozilla Thunderbird Content-Language: en-GB In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65599 List-Id: On 05/09/2023 08:23, Dmitry A. Kazakov wrote: > On 2023-09-05 01:16, Ben Bacarisse wrote: > >> The term "abstraction" is usually taken to be more general than that so >> as to include function (or procedural) abstraction. > > These are means of software decomposition rather than abstraction (of > something). They are both of these things, actually. > >> Ada is good at that, but the syntax is sufficiently cumbersome that I >> think it discourages people from exploiting that part of the language. >> Mind you, I am no Ada expert so maybe it's simpler to do than I think. > > If the program does not resemble electric transmission noise, some > people call the language syntax cumbersome... (:-)) 8-) >> Here's my Ada solution: >> >> with Ada.Text_IO; use Ada.Text_IO; >> with Ada.Containers.Ordered_Maps; use Ada.Containers; >> >> procedure Euler_26 is >> >>     function Period(Divisor: Positive) return Positive is > > You cannot use a number here because the period may have leading zeros. > >> I know it won't make this program shorter, but it would be interesting >> to know how it might be done. > > The goal of engineering is not making programs shorter, it is to make > them understandable, safer, reusable, maintainable, extensible, integrable. Hear, hear! Functionalists do seem to have an obsession with brevity at all costs. It's very strange. -- Bill F.