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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,33ce43bfeafb2681 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!h10g2000vbm.googlegroups.com!not-for-mail From: Eryndlia Mavourneen Newsgroups: comp.lang.ada Subject: Re: Concatenate enumeration Date: Tue, 24 Nov 2009 11:42:59 -0800 (PST) Organization: http://groups.google.com Message-ID: <3b19f303-1443-4e92-bdf2-21960ee92288@h10g2000vbm.googlegroups.com> References: NNTP-Posting-Host: 96.241.37.13 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1259091780 7449 127.0.0.1 (24 Nov 2009 19:43:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Nov 2009 19:43:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h10g2000vbm.googlegroups.com; posting-host=96.241.37.13; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.3 (KHTML, like Gecko) Chrome/4.0.223.16 Safari/532.3,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8227 Date: 2009-11-24T11:42:59-08:00 List-Id: On Nov 23, 1:15=A0pm, Pablo wrote: > Hi, I have a enumerate type and I have another one which I want to add > some enumerations. > So: > type Enumerate_Type is > =A0 ( > =A0 =A0NONE, > =A0 =A0READY > =A0 ); > for Enumerate_Type use > =A0 ( > =A0 =A0NONE =A0=3D> 0, > =A0 =A0READY=3D> 1 > =A0 ); > for Enumerate_Type'Size use 1; > > and I want to create a new type Enumerate2_Type which could be the > form > type Enumerate_Type is > =A0 ( > =A0 =A0NONE, > =A0 =A0READY, > =A0 =A0OFF > =A0 ); > for Enumerate_Type use > =A0 ( > =A0 =A0NONE =A0=3D> 0, > =A0 =A0READY=3D> 1, > =A0 =A0OFF =A0 =A0 =3D> 2 > =A0 ); > for Enumerate_Type'Size use 2; > > How to I do this without having to explicit clone the first one? > Thanks It sounds as if you want the binary values of your enumerations to be concatenated within a field. You *can* do this by declaring a record that has 2 fields, one for each enumeration. You then can use a representation clause to specify that the first type is contained in, say, the first bit of the record and that the second type is contained in the next 2 bits of the record. This has the effect of concatenating the bit representations of the types, but, of course, it does not concatenate the enumerations at the Ada level, that is, the literals themselves. Eryndlia