comp.lang.ada
 help / color / mirror / Atom feed
* Generic formal type with 'Image
@ 2018-06-06 13:03 Alejandro R. Mosteo
  2018-06-06 14:18 ` ytomino
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alejandro R. Mosteo @ 2018-06-06 13:03 UTC (permalink / raw)


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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-07 21:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox