From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Renaming primitives. Date: Wed, 10 Jan 2024 20:09:57 -0600 Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Thu, 11 Jan 2024 02:09:25 -0000 (UTC) Injection-Info: dont-email.me; posting-host="398f6d5c4c9ff6cbffb6894e51b840a0"; logging-data="2868371"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/shwaBp9cGNIQYm1bi94ey6mge0KSfPn0=" Cancel-Lock: sha1:fvBa5vMmL94ghn3zGjHM+5uTW3A= X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Response X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-Priority: 3 Xref: news.eternal-september.org comp.lang.ada:65980 List-Id: "Dmitry A. Kazakov" wrote in message news:unm1m6$2ftcd$1@dont-email.me... > On 2024-01-10 11:37, Blady wrote: ... >> To my surprise (well I hoped) My_Log_3 is compiled by GNAT. >> Is it conformed to the Ada standard? > > This looks like a bug to me. ARM 8.5.4 (2/3) states that the right part of > "renames" must be a name of a callable entity. My_Generic_Handler.Log is a > procedure call which is not a callable entity name. A "prefixed view" is indeed a view of a callable entity. For instance, you can pass those as generic formal subprograms or rename them. > Renaming a callable result of a function call might be legal [and quite > funny]. I believe that is legal as well. > Disclaimer. I am not a language lawyer. I'll refrain from a pithy remark. ;-) > P.S. Specialization of subprograms would be a nice feature, though. And Ada has had a limited form of it since Ada 2005. Limited because you can only eliminate the first parameter. (Of course, you can also eliminate the first two parameters, and so on. But you can't eliminate the third parameter, although you can default it and effectively eliminate from calls. Note that a renaming can change the defaults used for a subprogram call.) Randy.