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,a9bab26b6fe54a36 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Pondering what rationale behind record type 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: <90148303-4dc4-4c05-882f-88dd69a95494@z13g2000prk.googlegroups.com> <92quueFnsfU1@mid.individual.net> <4dc864b9$0$6890$9b4e6d93@newsspool2.arcor-online.net> <4dc90f7a$0$7659$9b4e6d93@newsspool1.arcor-online.net> <11dlfbvj00hru$.7zkw6im0a7gj$.dlg@40tude.net> <4dc92d14$0$6776$9b4e6d93@newsspool3.arcor-online.net> Date: Tue, 10 May 2011 14:50:50 +0200 Message-ID: <14o3gst7h97px$.g6k9bn5b3p4q$.dlg@40tude.net> NNTP-Posting-Date: 10 May 2011 14:50:50 CEST NNTP-Posting-Host: 313f2b31.newsspool3.arcor-online.net X-Trace: DXC=9LM^Rh\CQYWU6b:FjPaGjQMcF=Q^Z^V3X4Fo<]lROoRQ8kF On Tue, 10 May 2011 14:18:28 +0200, Georg Bauhaus wrote: > On 10.05.11 14:08, Dmitry A. Kazakov wrote: > >>> Anything wrong with (i.e. makes you shudder) >>> >>> Label_A: loop >>> ... >>> end loop Label_A; >>> >>> ? >> >> loop A do >> ... >> end A; > > Consequently, > > if ... then A do > ... > else > ... > end A; > > I guess? What is the reason to name statements? But if you wanted to, it would be if A do then ... else ... end A; >>> type Get_Token is function (File : File_Type) return >>> ((Matched : Boolean; Length : Positive) record >>> case Matched is >>> when True => Token : String (1..Length); >>> when False => null; >>> end case; >>> end record) >>> end Get_Token; >> >> No, Get_Token would be a function-type. > > Yes. It was suggested that the meat part of type declarations > should end in "end [X]", not "end keyword", so that > >> E.g. > > type Func is > function (X : Float) return Float; > end Func; No, because here there is no left bracket that follows "is". Compare type String is array (...) of ...; The type declaration syntax is: type is ; can be: 1. plain, e.g. private; range ...; delta ...; array; access ...; mod ... 2. nested, like task, record, protected object. Their declarations are unfortunately irregular. They should have been type Worker is task ... end Worker; type Mutex is protected ... end Mutex; type Data is record ... end Data; Of course one could deploy the alternative schema: type is ; E.g. task type A is ... end A; record type B is ... end B; array type String is (Positive range <>) of Character; range type Integer is -2**31-1..2**31-1; But mixing them was a bad idea. P.S. task and protected should have been record types with entries being primitive operations. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de