comp.lang.ada
 help / color / mirror / Atom feed
* "type X is abstract tagged limited private"
@ 2001-09-12  9:01 Sebastian
  2001-09-12  9:40 ` David C. Hoos, Sr.
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sebastian @ 2001-09-12  9:01 UTC (permalink / raw)


Hi,
I'm pretty new in Ada programming and a have seen this in a code example

pragma pure;
type X is abstract tagged limited private;
procedure y(a : in X);
private
type X is abstract tagged limited null record;

what is the meaning of this?

Thanks





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "type X is abstract tagged limited private"
  2001-09-12  9:01 Sebastian
@ 2001-09-12  9:40 ` David C. Hoos, Sr.
  2001-09-12 10:12 ` Preben Randhol
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: David C. Hoos, Sr. @ 2001-09-12  9:40 UTC (permalink / raw)
  To: comp.lang.ada

I suggest you consult an Ada textbook for this, as this is
quite an involved subject.  If you do not have
a textbook, the Ada Language Reference Manual is available
in both HTML and Windows Help file format at
ftp.ada95.com/pub/Ada_Ref_Man


----- Original Message ----- 
From: "Sebastian" <sebastian.madunic@esavionics.se>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: September 12, 2001 4:01 AM
Subject: "type X is abstract tagged limited private"


Hi,
I'm pretty new in Ada programming and a have seen this in a code example

pragma pure;
type X is abstract tagged limited private;
procedure y(a : in X);
private
type X is abstract tagged limited null record;

what is the meaning of this?

Thanks


_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "type X is abstract tagged limited private"
  2001-09-12  9:01 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
  3 siblings, 0 replies; 6+ messages in thread
From: Preben Randhol @ 2001-09-12 10:12 UTC (permalink / raw)


On Wed, 12 Sep 2001 11:01:07 +0200, Sebastian wrote:
> Hi,
> I'm pretty new in Ada programming and a have seen this in a code example
> 
> pragma pure;
> type X is abstract tagged limited private;
> procedure y(a : in X);
> private
> type X is abstract tagged limited null record;
> 
> what is the meaning of this?

I recommend that you get a good textbook:

Ada as A Second Language
<http://www.amazon.com/exec/obidos/ASIN/0070116075/qid=1000289345/sr=1-1/ref=sc_b_1/107-1988258-7344505>

is very good.

A quick introduction on Ada 95 can be found here:

http://goanna.cs.rmit.edu.au/~dale/ada/aln.html

Preben Randhol



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "type X is abstract tagged limited private"
       [not found] <02a701c13b6e$fef0cd80$1600000a@dhoossr>
@ 2001-09-12 11:13 ` M. A. Alves
  0 siblings, 0 replies; 6+ messages in thread
From: M. A. Alves @ 2001-09-12 11:13 UTC (permalink / raw)
  To: comp.lang.ada

There is a nice course book, in french, publicly available.  Dont have the
URL now, but it is by Daniel Feneuille of the I.U.T. Aix / D�partement
g�nie informatique--this should get you there.

On Wed, 12 Sep 2001, David C. Hoos, Sr. wrote:

> I suggest you consult an Ada textbook for this, as this is
> quite an involved subject.  If you do not have
> a textbook, the Ada Language Reference Manual is available
> in both HTML and Windows Help file format at
> ftp.ada95.com/pub/Ada_Ref_Man
>
>
> ----- Original Message -----
> From: "Sebastian" <sebastian.madunic@esavionics.se>
> Newsgroups: comp.lang.ada
> To: <comp.lang.ada@ada.eu.org>
> Sent: September 12, 2001 4:01 AM
> Subject: "type X is abstract tagged limited private"
>
>
> Hi,
> I'm pretty new in Ada programming and a have seen this in a code example
>
> pragma pure;
> type X is abstract tagged limited private;
> procedure y(a : in X);
> private
> type X is abstract tagged limited null record;
>
> what is the meaning of this?
>
> Thanks
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150 PORTO, Portugal        mob 351+939354002





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "type X is abstract tagged limited private"
  2001-09-12  9:01 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
  3 siblings, 0 replies; 6+ messages in thread
From: Darren New @ 2001-09-12 17:23 UTC (permalink / raw)


> type X is abstract tagged limited null record;
> what is the meaning of this?

But to summarize, it's saying that X is a type, it's an "OO" type
(tagged), it's abstract (you can't make objects of this type), it's
limited (you can't assign it), and it's a null record (meaning the
instances have no data because of this type).  The fact that it's
private means other stuff, too. Pretty complicated, eh? :-)

But I second the suggestion that you get Ada As A Second Language.

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
    Those who work hard with few results always 
           value hard work over getting results.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "type X is abstract tagged limited private"
  2001-09-12  9:01 Sebastian
                   ` (2 preceding siblings ...)
  2001-09-12 17:23 ` Darren New
@ 2001-09-12 17:24 ` Jeffrey Carter
  3 siblings, 0 replies; 6+ messages in thread
From: Jeffrey Carter @ 2001-09-12 17:24 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-09-12 17:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <02a701c13b6e$fef0cd80$1600000a@dhoossr>
2001-09-12 11:13 ` "type X is abstract tagged limited private" M. A. Alves
2001-09-12  9:01 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox