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!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.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: why "unconstrained subtype in component declaration" while said component given default value ? Date: Tue, 29 May 2018 17:28:46 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Tue, 29 May 2018 22:28:58 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="10641"; 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; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:52770 Date: 2018-05-29T17:28:46-05:00 List-Id: "Mehdi Saada" <00120260a@gmail.com> wrote in message news:a1c9fe86-bc14-48ee-bb64-24e40ae2b7e2@googlegroups.com... > Thanks Simon and Jeffrey. You just gave both of my points some legitimacy. Unfortunately, there would be major problems with access constraints (probably the worst idea overall in Ada 83, but we're obviously stuck with them). And access-to-specific-tagged works the same way. There's also an issue of implementation complexity: most Ada compiler use fixed size allocation for all composite objects in order to avoid implicit heap use (not allowed by many safety-critical customers). It's not possible to graft in arbitrary dynamic components in that case (recall that with a stand-alone object that there can only be a single dynamic thing. How does such a compiler deal with: type Nasty is record A : String := Some_Funct (...); B : String := Some_Funct (...); C : String := Some_Funct (...); end record; or worse: type Arr is (Positive range <>) of String; X : Arr := (1 .. Some_Other_Func(...) => Some_Funct (...)); The line has to be drawn somewhere for fixed allocations, and that was done at the stand-alone object boundary. Randy.