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!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: What exactly is the licensing situation with GNAT? Date: Fri, 14 Nov 2014 16:24:14 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <35f01472-3510-4f67-8765-006fa8591c35@googlegroups.com> <9tc8w.73007$ZT5.37595@fx07.iad> <22a3816a-4e89-48f0-a126-dce581781beb@googlegroups.com> <084b1934-9641-425e-85ec-293e0334413e@googlegroups.com> <86bf69c8-eb08-4696-b6c9-3784f5c42213@googlegroups.com> <87389olqie.fsf@ixod.org> <19fa65d4-72c9-44ab-b44b-4ea0929c18f2@googlegroups.com> NNTP-Posting-Host: 24-196-82-226.static.mdsn.wi.charter.com X-Trace: loke.gir.dk 1416003855 3992 24.196.82.226 (14 Nov 2014 22:24:15 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 14 Nov 2014 22:24:15 +0000 (UTC) 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.6157 Xref: news.eternal-september.org comp.lang.ada:23330 Date: 2014-11-14T16:24:14-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:fo7cw4s3dd6g$.1jh55iopdn64m$.dlg@40tude.net... > On Thu, 13 Nov 2014 15:51:54 -0600, Randy Brukardt wrote: > >> I recall Adam suggesting that some special sort of named >> access-to-subprogram type be defined with similar characteristics to the >> anonymous access-to-subprogram. Such a thing could be made to work, while >> the bare pointer used for normal access-to-subprogram types would not >> work. >> But of course it would be susceptible to dangling pointers, and won't >> (usually) be compatible with C. > > I was always wondering why it was not a plain subprogram type. That would > solve a lot of problem, interfacing C included. E.g. I don't know why it is an access rather than just directly a type. Perhaps a lack of imagination? But there's insufficient difference to justify the change today. OTOH, I don't see why this would be any different than access types vis-a-vis interfacing with C and the like. The type would have a representation (likely one similar to access-to-subprogram), and that's the problem for 'Unrestricted_Access - it needs a different representation to support 'Unrestricted_Access from 'Access. And the representation needed for 'Unrestricted_Access is incompatible with C (other than on GCC, which is unusual). If you simply allowed any subprogram to match a subprogram type, you couldn't allow interface to C. Or you'd have to have an accessibility check on the use only for interface to C. Or some other messy rule - would not gain anything. Randy.