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,a79ba897d64210ea X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: TYPE'Size in static expression Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.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: <4358A12B.4030601@dif.andthis.um.es> <435CBDDF.3040607@dif.andthis.um.es> Date: Mon, 24 Oct 2005 13:45:51 +0200 Message-ID: <103nkxb7oxxgt$.zi0lnvwylys0$.dlg@40tude.net> NNTP-Posting-Date: 24 Oct 2005 13:45:52 MEST NNTP-Posting-Host: a841d1e2.newsread2.arcor-online.net X-Trace: DXC=PfWfGne@jG4MXCiXZcgNO?Q5U85hF6f;4jW\KbG]kaM8SE6H=g?m\g:F;a7enW;^6ZC`4<=9bOTW=MN> X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:5904 Date: 2005-10-24T13:45:52+02:00 List-Id: On Mon, 24 Oct 2005 12:56:31 +0200, Francisco J. Montoya wrote: > That, indeed, solved my problem, but I still do not finish in > understanding why what I wrote did not work. The expression I wrote is > supposed to be of "Universal Integer Type", isn't it? So adding the > explicit type "Integer" to the constant definition should not make much > difference. "Universal integer constant" have to be static. But just constant T need not to be. This makes the difference. So you could also write: type Buffer is array (1..8 * Buffer_Size / BaseType'Size) of BaseType; Ada's rules about static expressions are a bit tricky. But for a generic body, it is clear that BaseType'Size cannot be static. [ Or, well, it could be, if generics were treated like C++ templates. But then sharing of generic bodies would be difficult, if possible. ] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de