comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: "type X is abstract tagged limited private"
Date: Wed, 12 Sep 2001 17:24:25 GMT
Date: 2001-09-12T17:24:25+00:00	[thread overview]
Message-ID: <3B9F9A49.B7757ACD@boeing.com> (raw)
In-Reply-To: 9nn76f$lml$1@newstoo.ericsson.se

Sebastian wrote:
> 
> pragma pure;

The package does not declare any library-level variables or named access
types, nor does it require any elaboration at run time.

> type X is abstract tagged limited private;

X is an abstract tagged type, which means no objects may be declared of
this type. The public view (outside the package) is limited private,
which means no operations are defined for the type or its descendants
except those declared in this package. Most importantly, assignment is
not defined for the type.

> procedure y(a : in X);

There is a procedure named Y which operates on objects of type X and
does something useful. Descendants of X will inherit this procedure.

> private
> type X is abstract tagged limited null record;

The full view of type X (within the package) is an abstract tagged
record with no components. The type is a limited type, which means that
assignment, "=", and "/=" are not defined for the type or its
descendants.

The type and its descendants will be passed by reference. Tagged types
are always passed by reference, and types with a full view that is
limited are always passed by reference. This type is both.

The visibility rules for child packages further complicate the matter,
but this should be enough for now. As others have pointed out, a good
textbook should prove helpful. You might also try the reference material
and tutorials available through

www.adapower.com

-- 
Jeffrey Carter



  parent reply	other threads:[~2001-09-12 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-12  9:01 "type X is abstract tagged limited private" Sebastian
2001-09-12  9:40 ` David C. Hoos, Sr.
2001-09-12 10:12 ` Preben Randhol
2001-09-12 17:23 ` Darren New
2001-09-12 17:24 ` Jeffrey Carter [this message]
     [not found] <02a701c13b6e$fef0cd80$1600000a@dhoossr>
2001-09-12 11:13 ` M. A. Alves
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox