comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: Limited Type Access
Date: Mon, 29 Oct 2001 14:16:59 -0500
Date: 2001-10-29T14:16:59-05:00	[thread overview]
Message-ID: <ttraje5rd2vr81@corp.supernews.com> (raw)
In-Reply-To: mailman.1004379225.31568.comp.lang.ada@ada.eu.org


<ANH_VO@udlp.com> wrote in message
news:mailman.1004379225.31568.comp.lang.ada@ada.eu.org...
> Greeting,
>
> I could not figure out why the codes below compiled without any error. My
> thought was that access type of a limited type is considered limited.

You may be confusing access types with array (really, "composite") types.
An array type whose component type is limited is itself limited.

An access type is always nonlimited, irrespective of the limitedness of the
designated type.

> Therefore,
> Object type must be limited because its component is limited. What did I
miss?

A record type containing a limited component is itself limited -- just like
for arrays.  A record type containing with only nonlimited components is
nonlimited.  However, in either case you are of course free to explicitly
declare a record type as limited:

    type Object is
       limited record
          Sem : Binary_Access;
       end record;


One of Bob Duff's ideas was to be able to declare array types as limited,
like this:

   type Limited_Array is limited array (Positive range <>) of Integer;
  --not legal Ada syntax









  parent reply	other threads:[~2001-10-29 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-29 16:08 Limited Type Access ANH_VO
2001-10-29 18:19 ` Mark Lundquist
2001-10-29 19:16 ` Matthew Heaney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-10-29 18:27 Beard, Frank
2001-10-29 23:59 ` Mark Lundquist
replies disabled

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