From: "Alejandro R. Mosteo" <alejandro@mosteo.com>
Subject: Re: Generic formal type with 'Image
Date: Wed, 6 Jun 2018 20:35:51 +0200
Date: 2018-06-06T20:35:51+02:00 [thread overview]
Message-ID: <pf99i7$b33$1@dont-email.me> (raw)
In-Reply-To: <pf8m2r$vj$1@dont-email.me>
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.
next prev parent reply other threads:[~2018-06-06 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 13:03 Generic formal type with 'Image Alejandro R. Mosteo
2018-06-06 14:18 ` ytomino
2018-06-06 15:34 ` Jeffrey R. Carter
2018-06-06 18:35 ` Alejandro R. Mosteo [this message]
2018-06-07 8:35 ` Marius Amado-Alves
2018-06-07 21:26 ` Randy Brukardt
2018-06-06 18:56 ` Shark8
2018-06-06 20:34 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox