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!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Generic formal type with 'Image Date: Wed, 6 Jun 2018 20:35:51 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 6 Jun 2018 18:35:51 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="2756c543bdefd44a119ce07376d563b7"; logging-data="11363"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rFl82QQhiOVMmmjBrUuSI" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:SNrxtk0MnhATu1dvpWKOHJP8LAY= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:52960 Date: 2018-06-06T20:35:51+02:00 List-Id: Thanks for the suggestions, and the link to the AI. I find these discussions fascinating. Alex. On 06/06/2018 15:03, Alejandro R. Mosteo wrote: > I'm pretty sure the answer is "no", but just in case: > > Is there a formal for a generic that serves for any type that has a > predefined 'Image? > > The purpose is to avoid: > > generic >    type Printable is ... -- What should go here? >    with function Image (P : Printable) return String is <>; > package > > and then have to pass the 'Image attribute as the Image function in all > instantiations. > > The closest thing I can think of is (<>) but that won't do for floating > point types. > > I understand this is an unusually narrow case (I need a generic for many > numeric types, both discrete and floating, and this would save me some > typing -- that I have already spent here anyway.) > > With these issues I feel a kind of overlap/missed connection between > attributes and interfaces. > > Thanks, > Alex.