comp.lang.ada
 help / color / mirror / Atom feed
* Limited Type Access
@ 2001-10-29 16:08 ANH_VO
  2001-10-29 18:19 ` Mark Lundquist
  2001-10-29 19:16 ` Matthew Heaney
  0 siblings, 2 replies; 5+ messages in thread
From: ANH_VO @ 2001-10-29 16:08 UTC (permalink / raw)
  To: comp.lang.ada

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. Therefore,
Object type must be limited because its component is limited. What did I miss?
Thanks for your help.

Anh Vo

package Limited_Access is

   protected type Counting ( Start_Count : Positive := 1) is
      entry Secure;
      procedure Release;
      
   private
      Current_Count : Natural := Start_Count;
   end Counting;
   
   subtype Binary is Counting (Start_Count => 1);
   
   type Binary_Access is access all Binary;
   
   type Object is 
      record
         Sem : Binary_Access;
      end record;

end Limited_Access;



^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: Limited Type Access
@ 2001-10-29 18:27 Beard, Frank
  2001-10-29 23:59 ` Mark Lundquist
  0 siblings, 1 reply; 5+ messages in thread
From: Beard, Frank @ 2001-10-29 18:27 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'

There is no limited type declared below.  You named your package
Limited_Access, but that doesn't make anything limited.  It's just
a name in this case.  You have to declare the type as limited.

There was a feature in Ada 83 that carries over to Ada 95.  You
couldn't pass a limited type object around, but you could pass
a pointer to the limited type object.

Frank

-----Original Message-----
From: ANH_VO@udlp.com [mailto:ANH_VO@udlp.com]
Sent: Monday, October 29, 2001 11:09 AM
To: comp.lang.ada@ada.eu.org
Subject: Limited Type Access


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.
Therefore,
Object type must be limited because its component is limited. What did I
miss?
Thanks for your help.

Anh Vo

package Limited_Access is

   protected type Counting ( Start_Count : Positive := 1) is
      entry Secure;
      procedure Release;
      
   private
      Current_Count : Natural := Start_Count;
   end Counting;
   
   subtype Binary is Counting (Start_Count => 1);
   
   type Binary_Access is access all Binary;
   
   type Object is 
      record
         Sem : Binary_Access;
      end record;

end Limited_Access;
_______________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2001-10-29 23:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-29 16:08 Limited Type Access ANH_VO
2001-10-29 18:19 ` Mark Lundquist
2001-10-29 19:16 ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
2001-10-29 18:27 Beard, Frank
2001-10-29 23:59 ` Mark Lundquist

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