comp.lang.ada
 help / color / mirror / Atom feed
From: Eric Hughes <eric.eh9@gmail.com>
Subject: Re: User-defined type attributes
Date: Mon, 17 Mar 2008 14:58:54 -0700 (PDT)
Date: 2008-03-17T14:58:54-07:00	[thread overview]
Message-ID: <0bed9b46-9b67-4b9c-b4c1-b8c27b60a356@s12g2000prg.googlegroups.com> (raw)
In-Reply-To: frmmbd$op0$1@jacob-sparre.dk

On Mar 17, 3:03 pm, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> In cases like these, you have to pass accessor routines explicitly.

Yeah, I figured that out this morning.  I should know better to post
at the end of the day before I've slept on it.

> It gives a
> default for the subprograms [...] (Why you can't have such defaults for types
> is unknown by me...)

Yeah, we just had that discussion two weeks ago.

> I would prefer to use an interface or tagged type here, but obviously you
> can't do that. This is not a perfect solution, but it works and is commonly
> used.

Notationally, it would be better, sure.  The problem, as you
acknowledge, is that it's a bad idea for a system library to require
any particular inheritance in order to work.  Working on this little
project has given substance to an idea I've had for a while about non-
inheritance type relationships.  In brief, it's to give a name to the
set of types that satisfy a certain set of signatures that,
critically, need _not_ be sufficient to form an abstract type.  This
specification constitutes a partial type.  To pick a simple example,
the set of trichotomous types is that which have a total ordering that
satisfy the standard trichotomy axioms (\forall a,b : a < b \land b <
a \implies a = b).  Trichotomy is a partial type.  It's a natural
parameter for generic ordered containers.

Indeed, partial types are the natural kind of formal type parameter
for any generic.  Right now in Ada they have to be simulated by
passing some set of formal parameters.  The spirit of Ada would be
better served by giving them an explicit representation.

Eric





      reply	other threads:[~2008-03-17 21:58 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       ` User-defined type attributes Randy Brukardt
2008-03-14  1:46       ` 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 [this message]
replies disabled

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