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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e91f674b5db5e2b2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-18 12:27:43 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Assigning the value of a deferred constant? Date: Tue, 18 Sep 2001 11:40:57 -0700 Organization: AdaWorks Software Engineering Message-ID: <3BA79539.D7FEA4A9@adaworks.com> References: <09Oo7.12082$mj6.1852826@news6-win.server.ntlworld.com> <%pnp7.2820$p77.4870@www.newsranger.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cc.b1 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 18 Sep 2001 18:38:34 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:13161 Date: 2001-09-18T18:38:34+00:00 List-Id: Ted Dennison wrote: > In article , Juanma Barranquero > says... > > >And vaguely related: Is there any way to declare a deferred constant > >and assign its value in the body of the declaring package, during > >elaboration? Something like: > > Sure. Declare it as a function instead of a constant. Ted makes an important point. Except for limited types, deferred constants should be promoted to functions. In fact, it seems this is now a good policy for most named numbers and declared values. This leverages one of the more powerful aspects of Ada: the ability to defer the implementation of a value to the body of a package. It also goes a long way towared satisfying the principle of referential transparency. Richard Riehle richard@adaworks.com