Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: User-define...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 23 of 23 Topic 5595 of 5922
Post > Topic >>

Re: User-defined type attributes

by Eric Hughes <eric.eh9@[EMAIL PROTECTED] > Mar 17, 2008 at 02:58 PM

On Mar 17, 3:03 pm, "Randy Brukardt" <ra...@[EMAIL PROTECTED]
> 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 relation****ps.  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
 




 23 Posts in Topic:
User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-12 11:58:29 
Re: User-defined type attributes
"Dmitry A. Kazakov&q  2008-03-12 22:23:43 
Re: User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-13 11:32:23 
Re: User-defined type attributes
"Dmitry A. Kazakov&q  2008-03-13 20:58:15 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-13 20:46:41 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-13 20:46:41 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-13 20:46:41 
Re: User-defined type attributes
"Dmitry A. Kazakov&q  2008-03-14 10:00:46 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-14 22:04:53 
Re: User-defined type attributes
"Dmitry A. Kazakov&q  2008-03-15 10:33:38 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-13 20:46:37 
Re: User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-13 20:55:27 
Re: User-defined type attributes
"Dmitry A. Kazakov&q  2008-03-14 10:01:47 
Re: User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-13 21:41:21 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-14 22:20:19 
Re: User-defined type attributes (replacing genericity)
Eric Hughes <eric.eh9@  2008-03-14 10:51:25 
Re: User-defined type attributes (replacing genericity)
"Dmitry A. Kazakov&q  2008-03-14 19:58:18 
Re: User-defined type attributes (replacing genericity)
"Randy Brukardt"  2008-03-14 23:01:56 
Re: User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-14 11:04:33 
Re: User-defined type attributes (replacing genericity)
Eric Hughes <eric.eh9@  2008-03-14 13:19:47 
Re: User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-16 21:38:37 
Re: User-defined type attributes
"Randy Brukardt"  2008-03-17 16:03:10 
Re: User-defined type attributes
Eric Hughes <eric.eh9@  2008-03-17 14:58:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 16:30:56 CDT 2008.