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: body stub not allowed in inner scope Date: Thu, 1 Mar 2018 16:45:26 -0600 Organization: JSA Research & Innovation Message-ID: References: <55cd79f5-4b37-4b08-b292-073ed2f37021@googlegroups.com><15c49c4e-726a-4fd7-bf35-c7d27ff9a491@googlegroups.com> <87tvtzv7rg.fsf@jacob-sparre.dk> Injection-Date: Thu, 1 Mar 2018 22:45:27 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="21770"; 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:50777 Date: 2018-03-01T16:45:26-06:00 List-Id: "Jacob Sparre Andersen" wrote in message news:87tvtzv7rg.fsf@jacob-sparre.dk... > Simon Wright writes: >> Randy Brukardt writes: > >> My use case for stubs is that I have a code generator that transforms >> a UML model into the framework of an Ada solution; subprograms, task >> and protected type bodies are generated as separates, so that there's >> no hassle with having the tool work out how not to overwrite the real >> bodies. This was triggered by bad experiences with Rational Rose back >> in 2000. > > This sounds rather similar to some work I've done for Consafe Logistics > last year. I wrote a code generator, which compiles Swagger/OAS > specifications of REST interfaces into packages declaring the services > and the types used. The actual service implementations are made > separate, to have the optimal separation of developer-written and > tool-written Ada code. The CLAW Builder generated code does this, but used user-generated packages for this purpose (rather than separates). The user provides the name of the package, and the generated code makes the needed calls. We were about to allow the user to choose to generate the package specifications for such packages (that never got implemented) so that the bodies would be easier to write (that would make the profiles of the needed routines obvious, rather than just being in the popup help for the builder). We never even considered subunits for this purpose (maybe should have? Dunno.) One never wants to mix machine-generated code (which the user should look at only in cases where there is a bug in the tools) with user-generated code (which the user obviously has to manage, and would prefer to use their normal IDE for development). Randy.