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: a07f3367d7,dbbbb21ed7f581b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!81.171.88.250.MISMATCH!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!195.114.241.41.MISMATCH!feeder.news-service.com!weretis.net!feeder2.news.weretis.net!news.mixmin.net!news2.arglkargh.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Operation can be dispatching in only one type Date: Tue, 1 Dec 2009 17:51:56 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <025105f2-5571-400e-a66f-ef1c3dc9ef32@g27g2000yqn.googlegroups.com> <1wtsriaxu0s4s$.ikwnnz5teukp$.dlg@40tude.net> <1iipp3bn16fe2.yqa1gz1ru17a$.dlg@40tude.net> <18wh86jvjvoe0.cofxcc8udm6q$.dlg@40tude.net> <53a35ed9-88ac-43dc-b2a2-8d6880802328@j19g2000yqk.googlegroups.com> <4b091fb9$0$6567$9b4e6d93@newsspool4.arcor-online.net> <1w0q3zxzw79pt$.5z0juiky7kfd$.dlg@40tude.net> <0f177771-381e-493b-92bb-28419dfbe4e6@k19g2000yqc.googlegroups.com> <1nbcfi99y0fkg.1h5ox2lj73okx$.dlg@40tude.net> <59acf311-3a4a-4eda-95a3-22272842305e@m16g2000yqc.googlegroups.com> <4b150869$0$6732$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1259711518 5855 69.95.181.76 (1 Dec 2009 23:51:58 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Dec 2009 23:51:58 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:8277 Date: 2009-12-01T17:51:56-06:00 List-Id: "Georg Bauhaus" wrote in message news:4b150869$0$6732$9b4e6d93@newsspool2.arcor-online.net... ... > If so, and presuming the programming language Ada is very much, > and explicitly, about storing and manipulating bits in registers, > memory words, ... of digital computers in a strongly typed fashion: > In this case I would know the use of being carried away by functional, > uhm, phantasm, pardon the expression. Rather, why not have Ada turn > warnings about "uninitialized" variables into a rule like Java's? Two obvious reasons: (1) Compatibility. Adding such a rule to Ada would ensure that 98% of existing Ada code would not compile. This is too fundamental a capability to take such an incompatibility. (2) Ada has a design goal of being implementable in a single pass compiler. A correllary of that goal is that legality rules cannot require flow analysis. Which means that any rule would have to be essentially the same as the one Dmitry is proposing: initialization is required in most cases; delayed initialization is OK only if it is unconditional. One has to think that using a conditional expression (as in Ada 2012 and in GNAT extensions) to initialize would be better than constructing some complex rules to allow initialization such as the one Bob suggested initially. One can certainly make the argument that the original design of Ada should have taken this problem more seriously (indeed, I think it is one of the worst mistakes of the original design team), but that doesn't make it any more likely that the language will be changed here. Probably the best that we could do today would be to add an Annex H restriction against default initialized objects that could have invalid values. (You'd want to allow well-defined default initialization as occurs for access types, it doesn't present a problem.) Then a particular project could require the use of that pragma and thus program in a safer Ada subset. (We could also help by making it easier to define default initial values for types other record types.) Randy.