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: Generic formal type with 'Image Date: Wed, 6 Jun 2018 15:03:22 +0200 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 6 Jun 2018 13:03:23 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="eb6eacc7d44f219ed26351d1744b61d3"; logging-data="1011"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1880QzsF/bhsAZN4t6XEMLx" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:C+gsTYfu4TOrwIypN7GcRH64AbE= Content-Language: en-US X-Mozilla-News-Host: news://news.eternal-september.org:119 Xref: reader02.eternal-september.org comp.lang.ada:52955 Date: 2018-06-06T15:03:22+02:00 List-Id: 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.