TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Tucker Taft <[log in to unmask]>
Date: Fri, 17 Jul 1998 13:17:38 -0400
Reply-To: Tucker Taft <[log in to unmask]>
Parts/Attachments: 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!