comp.lang.ada
 help / color / mirror / Atom feed
* Generic and visibility...
@ 2005-06-10 21:34 e.coli
  2005-06-11  1:18 ` Larry Hazel
  2005-06-11  4:44 ` Preben Randhol
  0 siblings, 2 replies; 6+ messages in thread
From: e.coli @ 2005-06-10 21:34 UTC (permalink / raw)


my program is structured like this:

--bar.ads
package Bar is
   generic
      with procedure Quuz;
   package Baz is

      task type Dummy is
         entry Run;
      end Dummy;

      type Ptr_Dummy is access Dummy;

      procedure Quz (
            X :    out Ptr_Dummy );

   end Baz;
 end Bar;

--bar.adb
with Ada.Text_Io;

package body Bar is
    T_Array : array (Integer range 1 .. 10) of Baz.Ptr_Dummy; --error
   package body Baz is

      task body Dummy is
      begin
         accept Run do
            Ada.Text_Io.Put_Line
               (Item => "Hello, Word!");
            Quuz; --generic procedure
         end Run;
      end Dummy;

      procedure Quz (
            X :    out Ptr_Dummy ) is
      begin
         X := new Dummy;
      end Quz;

   end Baz;
end Bar;


why i can't acces to Baz.Ptr_Dummy?
my deal is see the task pointer X outside Baz package.

thanks




^ permalink raw reply	[flat|nested] 6+ messages in thread
* generic and visibility
@ 2004-11-04 15:23 mferracini
  2004-11-04 18:59 ` Georg Bauhaus
  2004-11-05  3:39 ` John Woodruff
  0 siblings, 2 replies; 6+ messages in thread
From: mferracini @ 2004-11-04 15:23 UTC (permalink / raw)


i'm new on ADA, and i hav some problem
with generic.

this is an exemple



------------------------------------
package Manage is
generic
Id : integer;
with procedure Init;
with procedure Job;
package Det is

procedure Start(
Status :    out Integer );
end Det;
end Manage;

----------------------------------------

with Ada.Text_Io;
with Ada.Task_Identification;

package body Applicazione is
I : Integer := 0;

procedure Init is
begin
I:=1;
end Init;

procedure Job is
begin
Ada.Text_Io.Put(Item => "> mi sbatto!  ");
I:=I+1;
Ada.Text_Io.Put(Item => Integer'Image (I));
Ada.Text_Io.New_Line;
end Job;

end Applicazione;
-----------------------------------------

with Manage;
with Applicazione;


package Fake_App is new Manage_Task.Det_Task_M_Pack
(
Id_task => 1,
Init_Job => Applicazione.Init,
Job => Applicazione.Job);

---------------


with Fake_App;

procedure Test is
begin
Fake_app.job;
end Test;

---------------------------------------------------------------------------------
job in not a visible entry of fake_app

how i can do?
thanks




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

end of thread, other threads:[~2005-06-11  4:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-10 21:34 Generic and visibility e.coli
2005-06-11  1:18 ` Larry Hazel
2005-06-11  4:44 ` Preben Randhol
  -- strict thread matches above, loose matches on Subject: below --
2004-11-04 15:23 generic " mferracini
2004-11-04 18:59 ` Georg Bauhaus
2004-11-05  3:39 ` John Woodruff

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