>I would like an answer to the following as to why it wasn't considered for
>addition to the Ada standard:
>
>Why didn't user-defined attribute functions (not 'Read and 'Write) get
>incorporated into the standard.

>Example:
>  type An_Integer is range 0 .. 100;
>  function An_Integer'New_Stuff (A : in Integer) return An_Integer;

>Usage:
>  A : An_Integer;
>  B : An_Integer := An_Integer'New_Stuff (A);

>Well you get the gist.....

This was considered for Ada 95; it was in the earliest drafts.

Implementors (well, me :) pointed out that this was quite expensive
to add to existing Ada 83 compilers. Most Ada 83 compilers (and I
suspect most Ada 95 compilers as well) handle attributes with special
case code - something like "if id = "First" then - implement 'First.

Therefore adding user-defined attributes requires new resolution
code, and new symbol table code. There also was a need to
describe what happened when a user-defined attribute collided
with a language defined attribute like "First" that is not a function.

All of the this made the implementation reasonably complex.

All proposed Ada 95 features underwent a cost-benefit analysis,
and the cost of this feature was relatively high, and benefit was
relatively low, so it was deleted.

Tucker's team managed to resurrect some of the lower cost
features that were cut this way (such as 'Unchecked_Access
and library level renames), but of course everyone's good
ideas couldn't be included.

                        Randy Brukardt
                        Ada 9x Distiguished Reviewer