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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cae92f92d6a1d4b1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada.Execution_Time Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> Date: Tue, 21 Dec 2010 18:43:02 +0100 Message-ID: <109u0bk89dz98.1tygjy2pzqksg.dlg@40tude.net> NNTP-Posting-Date: 21 Dec 2010 18:43:03 CET NNTP-Posting-Host: 87293b7a.newsspool1.arcor-online.net X-Trace: DXC=<4:YZLCLO]ej5k5aEF7ISmic==]BZ:afn4Fo<]lROoRa<`=YMgDjhgbRUbKm`amj0n[6LHn;2LCVn[ On Tue, 21 Dec 2010 12:19:47 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> On Mon, 20 Dec 2010 22:23:12 -0500, Robert A Duff wrote: >> >>> Anyway, the strong syntactic separation between declarations >>> and statements makes no sense in a language where declarations >>> are executable code. I think it's just wrong-headed thinking >>> inherited from Pascal. >> >> It still does have sense in a language with lexical scopes. You need some >> syntactically recognizable point where all things of the same scope become >> usable. > > Yes, you need such a "syntactically recognizable point". > But that doesn't require any separation of declarations > from statements. If My_Assert is just a regular > user-defined procedure, then I see nothing wrong with: > > procedure P is > X : T1 := ...; > My_Assert(Is_Good(X)); -- Not Ada! > Y : T2 := ...; > My_Assert(not Is_Evil(Y)); > ... > > without sprinkling "declares" and "begins" all over. There are too many issues which are wrong here. 1. The exceptions from My_Assert cannot be handled in P. 2. Checking an instance of T1 is not bound to the type. It is done upon some arbitrary usage of T1 in an arbitrary procedure P. 3. Assuming that checking is really bound to the procedure P, then I want to be sure that checking is not premature, that P has elaborated all stuff belonging there, *before* I am starting to check things. 4. Ada *cannot* handle errors upon initialization and finalization. We have to fix that first before even considering checks in such contexts. etc. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de