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,a9bab26b6fe54a36 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!r35g2000prj.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Pondering what rationale behind record type Date: Tue, 10 May 2011 07:20:21 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> <14o3gst7h97px$.g6k9bn5b3p4q$.dlg@40tude.net> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1305037442 5634 127.0.0.1 (10 May 2011 14:24:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 10 May 2011 14:24:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r35g2000prj.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19217 Date: 2011-05-10T07:20:21-07:00 List-Id: On May 10, 1:50=A0pm, "Dmitry A. Kazakov" wrote: > 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) > > >>> =A0 =A0Label_A: loop > >>> =A0 =A0 =A0... > >>> =A0 =A0end loop Label_A; > > >>> ? > > >> loop A do > >> =A0 =A0... > >> end A; > > > Consequently, > > > if ... then A do > > =A0 =A0... > > else > > =A0 =A0... > > end A; > > > I guess? > > What is the reason to name statements? But if you wanted to, it would be > > if A do then > =A0 =A0... > else > =A0 =A0... > end A; > > > > > > > > > > >>> =A0 =A0type Get_Token is function (File : File_Type) return > >>> =A0 =A0 =A0 =A0((Matched : Boolean; Length : Positive) record > >>> =A0 =A0 =A0 =A0 =A0 =A0case Matched is > >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0when True =3D> Token : String (1..Length); > >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0when False =3D> null; > >>> =A0 =A0 =A0 =A0 =A0 =A0end case; > >>> =A0 =A0 =A0 =A0 end record) > >>> =A0 =A0end 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. > > > =A0 =A0 type Func is > > =A0 =A0 =A0 =A0function (X : Float) return Float; > > =A0 =A0 end Func; > > No, because here there is no left bracket that follows "is". Compare > > =A0 =A0type String is array (...) of ...; > > The type declaration syntax is: > > =A0 =A0type 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 > > =A0 =A0type Worker is task ... end Worker; > =A0 =A0type Mutex is protected ... end Mutex; > =A0 =A0type Data is record ... end Data; > > Of course one could deploy the alternative schema: > > =A0 =A0 type is ; > > E.g. > > =A0 =A0task type A is ... end A; > =A0 =A0record type B is ... end B; > =A0 =A0array type String is (Positive range <>) of Character; > =A0 =A0range 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. Kazakovhttp://www.dmitry-kazakov.de Doesn't 'type' become redundant at this point?... -- Martin