From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7769c087a4d30c0e,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "e.coli" Newsgroups: comp.lang.ada Subject: Unchecked_Conversion and task pointer. Date: 7 Jul 2005 08:50:55 -0700 Organization: http://groups.google.com Message-ID: <1120751455.846822.141050@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: 159.149.156.205 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1120751461 22324 127.0.0.1 (7 Jul 2005 15:51:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 7 Jul 2005 15:51:01 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=159.149.156.205; posting-account=OjhBzA0AAAC7IWpsLrvIpzjmXdzmh93y Xref: g2news1.google.com comp.lang.ada:11936 Date: 2005-07-07T08:50:55-07:00 List-Id: look at this exemple: ---------------------------------------------------- with Ada.Unchecked_Conversion; with Ada.Text_Io; procedure Main is task type Cain is entry Who_Are_You; end Cain; task type Abel is entry Who_Are_You; end Abel; type Ptr_Cain is access Cain; type Ptr_Abel is access Abel; task body Cain is begin loop accept Who_Are_You; Ada.Text_Io.Put_Line(Item => "I'm Cain"); end loop; end Cain; task body Abel is begin loop accept Who_Are_You; Ada.Text_Io.Put_Line(Item => "I'm Abel"); end loop; end Abel; function Mess_Up is new Ada.Unchecked_Conversion ( Source => Ptr_Cain, Target => Ptr_Abel); X : Ptr_Cain; Y : Ptr_Abel; begin X:= new Cain; Y:= new Abel; X.Who_Are_You; Y.Who_Are_You; Y:=Mess_Up(X); -- where are your brother? X.Who_Are_You; Y.Who_Are_You; end Main; ------------------------------------------------ how work Unchecked_Conversion with task pointer? the behavior depend by the compiler? thaks