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: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.snarked.org!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada 2012 Corrigendum Date: Fri, 12 Sep 2014 14:51:44 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1410547870 30897 192.74.137.71 (12 Sep 2014 18:51:10 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 12 Sep 2014 18:51:10 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:Ysy1vptdzw9wJzNPGVugg1FT9C0= Xref: number.nntp.dca.giganews.com comp.lang.ada:188986 Date: 2014-09-12T14:51:44-04:00 List-Id: Shark8 writes: > Here's what I have so far; suggestions? > > ----------------------------------------------------------------------- > Issue 1: Private Representation-Clauses and Subtypes Cannot be > Declared Together > > !topic Representation-Clause / Subtype Interaction > !reference None [?] You need at least one reference. > !from Edward Fish, 12 Sep 14 > !keywords Enumeration Representation Freezing Subtypes > > Given an enumeration which has values associated with it via a > representation clause the current freezing rules require that the > representation-clause appear before a subtype of that type -- it would > be desirable to be able to 'hide' the representation-clause in the > private section to prevent exposure to the client systems of what is > ultimately an implementation-detail. > > For this I propose an aspect that would indicate to the compiler that > there exists a representation-clause [in the private section] and > therefore does not cause the subtype derivation to freeze that aspect > (property) of the enumeration: "Delayed_Representation". (This aspect > would only be needed for enumerations, though there conceivably could be > reason to apply it to a private type and subtype [i.e. adding a > Type_Invarient condition on the subtype].) I'm afraid this isn't going to fly. If it were feasible, then why would you need an aspect? You could just allow the rep clause to come later than is currently allowed. But I suspect it's not feasible. Have you read the AARM annotations in 13.14? You should, if you're going to suggest changing the freezing rules. For one thing, your suggestion violates 13.14(1.n). You should at least have an explicit argument as to why you think that's OK. I don't know if it violates any other parts 13.14 -- it's a lot of work to study the freezing rules. The freezing rules are extremely delicate, so I doubt ARG will want to change them for a minor stylistic improvement. Sure, it might be stylistically better to put rep clauses in the private part, but it's hardly an important capability. Ideally, there would be no freezing rules. They are a language design flaw. Nobody understands them, and yet everybody trips over them. The solution (decades too late) would be to NOT elaborate package specs; package specs should be purely compile-time interface definitions. In that case, I think freezing rules would be unnecessary. One general piece of advice: Language changes are more likely to happen if the person proposing them shows the exact wording changes to the RM. But I realise that not everbody is fluent in the strange English-like language in which the RM is written. ;-) - Bob