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!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!reality.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: I am not understanding user defined exceptions Date: Fri, 10 Feb 2017 15:09:34 -0600 Organization: JSA Research & Innovation Message-ID: References: <6cb6e781-c6df-4962-99e3-760e7c7fab88@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1486760975 814 24.196.82.226 (10 Feb 2017 21:09:35 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 10 Feb 2017 21:09:35 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33316 Date: 2017-02-10T15:09:34-06:00 List-Id: "Robert A Duff" wrote in message news:wccfujnf042.fsf@TheWorld.com... > "Randy Brukardt" writes: > >> Most likely: >> >> X : Integer := ...; -- Static constant >> X : constant Integer := ...; -- Non-static constant >> X : variable Integer := ...; -- Variable. >> >> Since the default should be the safest thing. > > Well, at least we agree on one thing. It's odd that Ada got it right > for parameters ('in' is the default), but got it wrong for object > declarations (variable is the default). > > I'd be happy with: > > X : Integer := ...; -- constant > X : var Integer := ...; -- variable (1) Ada doesn't generally use abbreviations, thus "var" isn't a likely keyword. (2) It's important that all properties that clients can depend upon are declarable, so clients aren't depending on accidental properties. (That's the whole principle behind private types.) Static is such a property, so it should be declarable (not necessarily have to be declared in all cases). [Indeed, it should be possible to declare static private types - a whole different kettle of fish.] Similarly, it would be nice if there was a way to prevent people from depending upon the subtype profile of a subprogram (so that it can later be changed if necessary). There's probably other such properties (one would like to include formal parameter names in this sort of restriction, but that would prevent named calls which would be evil.) Randy.