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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,99934eaa35a086e8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why should the value for a discriminant be static? References: <420A6FA5.9040802@nowhere.fi> <420B5D9B.8060400@nowhere.fi> In-Reply-To: <420B5D9B.8060400@nowhere.fi> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 11 Feb 2005 01:40:47 GMT NNTP-Posting-Host: 63.190.73.80 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1108086047 63.190.73.80 (Thu, 10 Feb 2005 17:40:47 PST) NNTP-Posting-Date: Thu, 10 Feb 2005 17:40:47 PST Xref: g2news1.google.com comp.lang.ada:8231 Date: 2005-02-11T01:40:47+00:00 List-Id: Niklas Holsti wrote: > Now then, that's rather harsh. It's certainly legal Ada; if you think > its philosophically faulty, you are entitled to your opinion and I am > entitled to disagree; if you think its faulty because it leads to > practical problems, the problem is just with the requirement for > static discriminants in aggregates -- which is what this thread is > about. Not at all. There's a software engineering principle that one thing should serve one purpose, and this violates that: it serves both to identify the 2 classes and to provide the specific information for each class. > Which loses the compile-check that the assigned components exist > and that all existing components are assigned. This is what I > (and others) want to avoid. Of course it can be an emergency > solution as in your anecdote. The compile-time check exists at the point of the call to the function in this case, but in the general case that doesn't hold. On the other hand, when designed properly, you do get the compile time check. > The question is one of symmetry: since the language allows static > subtypes in the declaration of the variant parts of a record type, > it should symmetrically allow statically subtyped expressions as > discriminant values in aggregates for such record types. So, I guess the language must be faulty to allow static subtypes for variants. -- Jeff Carter "I spun around, and there I was, face to face with a six-year-old kid. Well, I just threw my guns down and walked away. Little bastard shot me in the ass." Blazing Saddles 40