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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_WORDY,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f20f5dfbb5c26c12,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-02 11:46:13 PST Path: archiver1.google.com!news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!zeus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Vincent Smeets" Newsgroups: comp.lang.ada Subject: discriminant in constraint must appear alone Date: Tue, 2 Dec 2003 20:43:16 +0100 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: news.t-online.com 1070394231 00 31324 mZMZG-UJMTjdUeB 031202 19:43:51 X-Complaints-To: usenet-abuse@t-online.de X-ID: GJkE-aZEweBjGnJHvEw0R9rCE8jwu49DWFir0O8ycirHIH-Kbe9xoQ X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:3076 Date: 2003-12-02T20:43:16+01:00 List-Id: Hallo, I want to define a discriminated record type with two arrays. One array = only half the size of the other. Below is the type definition that I = want to use. type R (D : Positive) is record A : String (1 .. D); B : String (1 .. D / 2); end record; This type definition can't be compiled by the GNAT compiler. It gives = the error message "discriminant in constraint must appear alone" for the record component B. I know this isn't correct Ada, but how = should I define the type in a correct way? I have defined B as B : String (1 .. D); and only used the first half of it, but this way I waist memory and = can't have any Ada constraint checks for component B. So this is not the = way I want to do it. Are there other possiblities? --=20 Thanks, Vincent Smeets