comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: User-defined type attributes
Date: Thu, 13 Mar 2008 20:46:41 -0500
Date: 2008-03-13T20:46:41-05:00	[thread overview]
Message-ID: <frcnqe$5tr$1@jacob-sparre.dk> (raw)
In-Reply-To: 965suhjl0bxt$.74se2ylyksin.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:965suhjl0bxt$.74se2ylyksin.dlg@40tude.net...
...
> Why? The only thing you need is formal generic ADTs. Ada's generics lack
> ADTs, which is the reason why you need to pass operations together with
the
> formal types. There exist formal built-in types like "private", "<>",
> "digits <>" etc, but there is no user-defined ones. Add these and all
> primitive operations will go with the actual type just per magic. It would
> be IMO a natural step for anybody who wanted generics to evolve in an
> Ada-way. (Not for me, as you know, I prefer generics removed from the
> language.)

Generic formal derived types are the way to bring an ADT into a generic.
After all, they do bring in all of the primitive operations of the ADT.

The only problem is that they can't be used on unrelated types, but that's
not very relevant if you are using tagged types (and you might as well being
doing so if you're defining any sort of composite type).

                                                        Randy.





  parent reply	other threads:[~2008-03-14  1:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 18:58 User-defined type attributes Eric Hughes
2008-03-12 21:23 ` Dmitry A. Kazakov
2008-03-13 18:32   ` Eric Hughes
2008-03-13 19:58     ` Dmitry A. Kazakov
2008-03-14  1:46       ` Randy Brukardt
2008-03-14  9:00         ` Dmitry A. Kazakov
2008-03-14 14:36           ` User-defined type attributes (replacing genericity) Georg Bauhaus
2008-03-15  3:04           ` User-defined type attributes Randy Brukardt
2008-03-15  9:33             ` Dmitry A. Kazakov
2008-03-14 14:31         ` User-defined type attributes (replacing genericity) Georg Bauhaus
2008-03-14 14:48           ` Dmitry A. Kazakov
2008-03-14 17:51             ` Eric Hughes
2008-03-14 18:58               ` Dmitry A. Kazakov
2008-03-14 20:19                 ` Eric Hughes
2008-03-15  4:01               ` Randy Brukardt
2008-03-14 16:58           ` Georg Bauhaus
2008-03-14 18:39             ` Dmitry A. Kazakov
2008-03-15  9:39               ` Dmitry A. Kazakov
2008-03-14  1:46       ` Randy Brukardt [this message]
2008-03-14  1:46       ` User-defined type attributes Randy Brukardt
2008-03-14  3:55       ` Eric Hughes
2008-03-14  9:01         ` Dmitry A. Kazakov
2008-03-14 18:04           ` Eric Hughes
2008-03-14  1:46 ` Randy Brukardt
2008-03-14  4:41   ` Eric Hughes
2008-03-15  3:20     ` Randy Brukardt
2008-03-17  4:38       ` Eric Hughes
2008-03-17 21:03         ` Randy Brukardt
2008-03-17 21:58           ` Eric Hughes
replies disabled

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