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 autolearn=ham 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 19:07:10 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.media.kyoto-u.ac.jp!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!not-for-mail Message-ID: <3BA7FDE0.82D@li.net> From: Vincent Marciante X-Mailer: Mozilla 3.0 (OS/2; I) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Assigning the value of a deferred constant? References: <09Oo7.12082$mj6.1852826@news6-win.server.ntlworld.com> <%pnp7.2820$p77.4870@www.newsranger.com> <3BA79539.D7FEA4A9@adaworks.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 18 Sep 2001 22:07:28 -0400 NNTP-Posting-Host: 168.191.118.163 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 1000865227 168.191.118.163 (Wed, 19 Sep 2001 02:07:07 GMT) NNTP-Posting-Date: Wed, 19 Sep 2001 02:07:07 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:13170 Date: 2001-09-18T22:07:28-04:00 List-Id: Richard Riehle wrote: > > 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 But a deferred contant might be completed by a static expression, making its use legal in more places than where a function call is legal - right? Vinny