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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7be3870dd9c9518f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-15 06:04:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Alfred Hilscher Newsgroups: comp.lang.ada Subject: Re: CONSTRAINT_ERROR - why? Date: Sun, 15 Dec 2002 15:01:39 +0100 Organization: T-Online Message-ID: <3DFC8B43.68D99D1C@t-online.de> References: <3DFB7841.F898C02@t-online.de> <3DFB9276.7070809@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1039960990 06 25837 BT06EtCGSFA2f0 021215 14:03:10 X-Complaints-To: abuse@t-online.com X-Sender: 320001779794-0001@t-dialin.net X-Mailer: Mozilla 4.75 [de] (WinNT; U) X-Accept-Language: de Xref: archiver1.google.com comp.lang.ada:31849 Date: 2002-12-15T15:01:39+01:00 List-Id: Jeffrey Carter schrieb: > The value passed to Left is not in the range of Byte. If you want this > evaluated as a universal expression, you have to add a step: > > declare > Value : constant := X'Size / 8; > begin > Y := Value; > end; > > There is no "extra assignment". This is a static universal expression > and is evaluated by the compiler. Value becomes a name for the resulting > value (a "named number"). The block statement above is another way to write I tried, but - it does not compile: "non-static expression used in number declaration". So it's _not_ a static expression and will generate code which will be executed during runtime. I discussed the "why is 'size not static?" about half a year ago in cla (when I tried to declare a "type a is array (1..(x'size/8)) of character"). "As longer I do Ada, as more I love C." > -- > Jeff Carter > "Why don't you bore a hole in yourself and let the sap run out?" > Horse Feathers