From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20,T_SCC_BODY_TEXT_LINE, XPRIO autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Why don't all initialising assignments use 'build-in-place' ? Date: Sat, 25 Mar 2023 03:39:14 -0500 Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Sat, 25 Mar 2023 08:39:15 -0000 (UTC) Injection-Info: dont-email.me; posting-host="6687f069bfe0f361727be044aacd443a"; logging-data="2229484"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iJzcbYF/pyabp8jhnBOyW6ZJkJfqWToY=" Cancel-Lock: sha1:UBIcAN2ldIRYBPasPOa1lb+WSyk= X-RFC2646: Format=Flowed; Response X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 Xref: feeder.eternal-september.org comp.lang.ada:65019 List-Id: "Rod Kay" wrote in message news:tvc6j9$3gfe$1@dont-email.me... > Hello again, > > I'm sure there must be a good reason. All I can think of is that it may > somehow break backwards compatibility wrt controlled types (a vague stab > in the dark). > > Any thoughts ? (1) Didn't want to make work for implementers. (2) You shouldn't be able to tell (since it is required for all cases involved finalization). Finalization is the only way to inject user-defined code into the initialization process. (3) True build-in-place can be expensive and complex (especially for array types). (4) Build-in-place requires functions compiled to support it (must pass in the place to initialize into). That might not be the case (especially if a foreign convention is involved). Also see (3) - an implementation might have a cheaper way to return some types that doesn't support build-in-place. There's probably more, those are off the top of my head. If it is cheap, it would be silly for an implementation to do anything else. (Don't ask what Janus/Ada does. ;-) Otherwise, most people want the fastest possible code. Randy.