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 > User-defined ty...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 23 Topic 5595 of 5800
Post > Topic >>

User-defined type attributes

by Eric Hughes <eric.eh9@[EMAIL PROTECTED] > Mar 12, 2008 at 11:58 AM

In light of the recent discussion of formal package parameters, I have
been wondering about user-defined type attributes.  They don't
currently exist in any version of Ada.

First, a historical question: Was there a proposal for user attributes
that was considered for Ada 2005?

My interest in them is akin to my interest in formal package
parameters.  The prefixed views for functions and procedures (dot-
notation) of Ada 2005 are directly analogous to what would be required
for attribute syntax.  This notation hints at the possibility of a
kind of visibility related to formal type parameters, one which would
make ordinary subprograms and attribute functions visible without
making the entire definition package visible.  The idea is that a
formal type parameter create a visibility related only to that type
itself.  In order to make this really useful, attribute functions
would be needed to forestall the use of an entire package, rather than
only a single type.

If this seems abstruse, just consider the character traits that the C+
+ standard library uses.

And a related historical question: Why does the prefixed view of a
subprogram only apply to tagged types?  It seems like a syntax
eminently suited for any subprogram.

An attribute function must evaluate at compile-time, or perhaps more
subtly, prior to elaboration time.  Much of the requisite apparatus is
already present with static expressions and preelaborable packages.
The standard would require an additional definition of the ability to
pre-elaborate a function body.  While such a body might be restricted
to returning a single static expression, that seem a bit restrictive.

My overall motivation (as before) is to enable better, more flexible
library sup****t.  Library sup****t gates usability and enables cost-
justifiable selection of Ada in a greater number of application
domains.  These kinds of features are not so critical for a single
team writing their own software, but rather come into their own when
writing libraries for other people to use in not-yet-anticipated ways.

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 Sun Jul 6 18:47:49 CDT 2008.