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 X-Received: by 2002:a37:9e47:: with SMTP id h68mr5627525qke.251.1575386953481; Tue, 03 Dec 2019 07:29:13 -0800 (PST) X-Received: by 2002:a9d:155:: with SMTP id 79mr3374918otu.240.1575386953318; Tue, 03 Dec 2019 07:29:13 -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!g89no1582859qtd.0!news-out.google.com!w29ni85qtc.0!nntp.google.com!g89no1582852qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Dec 2019 07:29:13 -0800 (PST) In-Reply-To: <5e222e6c-7afe-4349-ac66-d9b78ca40ec6@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.234.173; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.234.173 References: <87muca3vgd.fsf@nightsong.com> <57d49047-0a61-4d13-8822-d004732a3acc@googlegroups.com> <3b1b248b-43d0-4762-b1f5-1c5460d24c8b@googlegroups.com> <5e222e6c-7afe-4349-ac66-d9b78ca40ec6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <27b11294-d628-4118-8328-a4a9a3946937@googlegroups.com> Subject: Re: Beginning Ada Programming, by Andrew T. Shvets (2020) From: Optikos Injection-Date: Tue, 03 Dec 2019 15:29:13 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:57637 Date: 2019-12-03T07:29:13-08:00 List-Id: On Tuesday, December 3, 2019 at 9:04:13 AM UTC-6, Lucretia wrote: > On Tuesday, 3 December 2019 14:04:24 UTC, AdaMagica wrote: > > Am Dienstag, 3. Dezember 2019 14:57:53 UTC+1 schrieb Lucretia: > > > People coming from other languages might not grasp types easily, > >=20 > > Hey, what's difficult to understand in > >=20 > > type Temperature is range -40 .. 40; -- Celsius > >=20 > > for a home thermometer? >=20 > I don't have a problem, I get it, I'm saying that apparently other people= do. But still, there's nothing > wrong with just starting with pre-defined types, they're there for a reas= on. Jesus! There is a wise middle ground between the 2 extremes between what you & Ada= Magica are saying. strict) AdaMagica appears to be saying that rock-solid analysis of finding = the upper & lower bounds of the integer's range (or fixed or floating point= or BCD for that matter) is of crucial insight & importance to understandin= g the problem. loose) You appear to be saying that for rapid prototyping that that deep an= alysis can be postponed. midling) The middle ground is to use a named type* of a predefined** (not r= ange-restricted subtype of) predefined type that represents the problem dom= ain's meaning. Then at a (perhaps much) later time restrict the range of t= hat named type only at the single point of declaration in the package speci= fication, which then takes effect at all points of usage of that named type= in other declarations and in the package body without modifying all those = points of usage to refer to a different name(d type). * the same named type in midling as in strict) ** the same unsubtyped predefined type as in loose) Midling hence achieves loose's rapid prototyping and strict's ease of deplo= ying the most-correct subtype restricted range=E2=80=94hence the wisdom. (= Perhaps midling is actually what either or both AdaMagica & Lucretia speake= rs were actually intending to say more tersely, but perhaps some readers we= re missing these finer points in the terseness.)