Unchecked_Conversion and task pointer.



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

.



Relevant Pages

  • Re: Unchecked_Conversion and task pointer.
    ... > task type Cain is ... > task type Abel is ... task type Soul is ...
    (comp.lang.ada)
  • Re: The Borrowings of the Koran
    ... Here's the conclusion from "On The Sources Of The Story Of Cain & Abel ... to have been borrowed from Jewish sources like the Targum ... "It is not said here blood in the singular, but blood in the plural, ...
    (soc.religion.islam)
  • Re: OT: In the Begining
    ... Cain turned the tape of, informing Abel of the hose ... Abel wanted Adam to go and get more cleaner as ...
    (uk.politics.misc)
  • Re: The Borrowings of the Koran
    ... sincere seekers can refer to "Refutation Of The Borrowing ... and "On The Sources Of The Story Of Cain & Abel In The Qur'an", ... Abel as narrated in the Qur'an were borrowed from the Jewish sources ...
    (soc.religion.islam)
  • RE: Cain a& Abel Question
    ... Subject: Cain a& Abel Question ... Your browser negotiates an SSL connection with C&A. C&A negotiates ... that are enforced to protect WLANs from known vulnerabilities and threats. ...
    (Pen-Test)