with Ada.Text_Io; use Ada.Text_IO; procedure partd is N:constant := 8; type Index is mod N; type Item_Array is array (Index) of character; protected type Buffering is entry Put(X: in character); entry Get(X: out character); private A:Item_Array; I,J : Index := 0; Count : Integer range 0..N := 0; end Buffering; protected body Buffering is entry Put(x: in character) when Count0 is begin x := A(J); J := J+1; Count := Count-1; end Get; end Buffering; My_Buffer : Buffering; x : character; begin -- partd start My_Buffer.Put ('a'); My_Buffer.Get (x); put(x); end partd;