TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Tucker Taft <[log in to unmask]>
Reply To:
Tucker Taft <[log in to unmask]>
Fri, 17 Jul 1998 13:17:38 -0400
text/plain (24 lines)
> >It was never clear to me why type declarations aren;t allowed in
> >the private part of a P.T. They are purely compilation-time
> >things and would not increase the execution overhead. What's
> >the rationale for excluding them?
> Here's a hint: they used to be called "protected records".

They follow the general rule against nesting type definitions inside other
type definitions.  When you nest one type inside another, you end
up with a number of semantic "nasties" such as where are the predefined
operators declared, and what are the type equivalence rules.
Do you name the predefined operators by saying object."=" or type."="?
Does each object of the enclosing type have its own distinct nested type?

It could certainly all have been worked out, but as suggested by Pat above,
the issues are essentially the same for nesting type definitions
inside protected type definitions and for nesting them inside
record type definitions.

> Really!