TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

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

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

Print Reply
Fri, 14 Feb 2003 02:11:21 +0300
text/plain (12 lines)
>I consider Ada packages as static (non-instantiable) classes, where children
>inherits their static nature.
>  Does that make sense ?
Too narrow sense. Although you do not instantiate non-generic packages (if you
do not treat "with" clause as a kind of instantiation), you may instantiate
new types from them, deriving from private types declared in those packages.
  Look at the difference between "new" in C++ and "new" in Ada. "new" in C++
is run-time action, which produces new copy of object of the class, while
"new" in Ada is compile-time action, which produces new type, and that new
type is neither subtype nor supertype of original type... but it is defined
by the same package as the original type.