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: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!news.karotte.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: 'Protected' abstract subprograms Date: Mon, 20 Jan 2014 19:21:54 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <839fee13-2743-49f6-a7f3-f95578386201@googlegroups.com> <1aav8alqsnqqv.5urmifgwh1mv.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1390267314 3744 69.95.181.76 (21 Jan 2014 01:21:54 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 21 Jan 2014 01:21:54 +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 X-Original-Bytes: 5528 Xref: number.nntp.dca.giganews.com comp.lang.ada:184490 Date: 2014-01-20T19:21:54-06:00 List-Id: "Robert A Duff" wrote in message news:wccob37vfxe.fsf@shell01.TheWorld.com... > "Randy Brukardt" writes: > >> "Robert A Duff" wrote in message >> news:wccvbxje5sn.fsf@shell01.TheWorld.com... >> ... >>> The freezing rules make my brain hurt. Even though I had a hand in >>> writing them! ;-) >>> >>> A better-designed language would not have anything like freezing rules. >> >> That's a facinating assertion from the guy that's responsible for most >> the >> AARM notes describing the freezing rules. Especially as you guys pretty >> much >> redesigned that area in Ada 95 -- you essentially created a whole new >> language design for it. > > Not really. Ada 83 had "forcing occurrences" regarding rep clauses. > And I think a bunch of similar rules regarding premature use > of private types. IIRC, we decided that these two sets of rules > should be combined. Also, the rules were buggy, and we wanted > to fix them. > > The actual rules in Ada 95 are almost the same as in Ada 83. They > don't look the same, because the wording was changed a lot. But > the things that are legal and illegal in Ada 83 didn't change > much in Ada 95. > > In other words: Don't mix up "the Ada language" with "the words we > use to describe the Ada Language in the RM". The latter can change > without changing the former. And in this case, the latter changed > a lot while the former changed a little. Of course, I know this, but I don't really think that this is relevant. You ("you" meaning Ada 9x team here since I don't know for sure who did what) could have changed the language more (since you guys had already decided to change the wording drastically), but you didn't. I would say that was mainly because it wasn't really possible to change the language further without changing it's philosphosy. After all, you did make a number of cases illegal that were legal in Ada 83. >>... It makes me wonder how a language could be better >> designed and not "have anything like freezing rules". > > Well, I'm too lazy to give all the details, but here's one key point: > > It is obvious[*] that module specs should not be elaborated. They should > be purely a compile-time description of the interface, and should not > exist at all at run time. > > [*] I'm just kidding about "obvious". It took me years to figure that > out. But having done so, it's obvious (to me). > > Another point: Something like Ada's aspect clauses are better than > pragmas and separate syntax for rep clauses. That's because aspect > clauses are physically attached to the declaration, so there's less > of an issue about when things are evaluated. Also, you don't have > to refer to the thing by name; you're just saying "this thing has > so an so properties". Every time you refer to something by name, > you put a (slight) burden on the person reading the code, who has > to match up uses with declarations. Right. Aspect clauses eliminate quite a bit of the need for freezing rules. (Although we ended up using them to describe the semantics of aspect clauses, that was mainly historical in nature -- it would have been better to wait until the end of the unit for those determinations, but that would have not allowed various things legal in Ada.) I believe your point that a purely compile-time description would eliminate freezing. I'm not convinced that such a restriction would really be usable -- I suppose it depends on what could actually be described that way. (Personally, I find Ada interfaces useless; I much prefer package specifications for abstraction. I'm not sure if that carries over to your idea.) Anyway, not particularly relevant for Ada, since we're surely not reducing what is allowed in a package specification. Randy.