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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: formal array types and default values Date: Mon, 8 Jan 2018 15:12:39 -0600 Organization: JSA Research & Innovation Message-ID: References: <053b2370-5c15-4662-a9e3-e1464de206a1@googlegroups.com> Injection-Date: Mon, 8 Jan 2018 21:12:39 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="17725"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:49817 Date: 2018-01-08T15:12:39-06:00 List-Id: "Niklas Holsti" wrote in message news:fbaifmFd3gjU1@mid.individual.net... ... >> I forget the reason that we required staticness, but I think it had >> something to do with when the default expression is evaluated. > > From the discussion in AI05-0228, it seems to be related also to type > freezing: Robert Dewar reported "huge problems" implementing the > Default_Value aspect, and Randy Brukardt replied: "The key is to > note that as these have to be static expressions, they can't involve the > creation of any default-initialized objects (no user-defined function > calls). Thus, I would suggest that the best approach would be to handle > Default_Value aspects immediately *after* freezing of the type (but before > anything else that depends on freezing." ... "If there is anything that > would be a problem, the checking for a static expression will catch it." > > However, I found no discussion in the AI re *why* the AI was initially > written to require a static expression for Default_Value, nor why > Default_Component_Value is limited to scalars. My recollection was that it was more that the expressions involved had to be very restricted in order to avoid problems (perhaps the problems were with freezing). The easiest way to do that was to make the items static. BTW, if you want to follow all of the design issues that are recorded, you probably need to look at the meeting minutes as well as the AI. There is an index of meeting discussions on AIs found on the ARG Minutes page (http://www.ada-auth.org/arg-minutes.html). Randy.