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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1b5fd0c8f03e0168 X-Google-Attributes: gid103376,public From: mcc@tyrolia.cs.princeton.edu (Martin C. Carlisle) Subject: Re: Assignment of Classwide Types Date: 1998/09/03 Message-ID: <6sn45v$j7f$1@cnn.Princeton.EDU>#1/1 X-Deja-AN: 387637908 References: <6smnns$2vj$1@nnrp1.dejanews.com> Organization: US Air Force Academy, Dept of Computer Science Newsgroups: comp.lang.ada Date: 1998-09-03T00:00:00+00:00 List-Id: The following works for me. Perhaps you could be more specific? --Martin with ada.integer_text_io; procedure bob is type parent is abstract tagged record checksum : Integer; end record; type parent_access is access all parent'class; type child is new parent with record new_field : integer; end record; x, y : parent_access := new child; begin y.checksum := 3; x.checksum := 4; x.all := y.all; Ada.Integer_Text_io.Put(x.checksum); end bob; In article <6smnns$2vj$1@nnrp1.dejanews.com>, wrote: >Hello Everyone: I have a tagged type declared as > >type PARENT_TYPE is abstract tagged private; > >private > type PARENT_TYPE is abstract tagged with > record > checksum : INTEGER; > end record; > > type ACCESS_TO_PARENT_TYPE is access all PARENT_TYPE'class; >--------------------------------------------------------------- > > PTR1 : ACCESS_TO_PARENT_TYPE; > PTR2 : ACCESS_TO_PARENT_TYPE; > > I have PTR1 & PTR2 having access to diff. memory locations where I have >PARENT_TYPE (same tag but diff. data). > then I say, PTR1.all := PTR2.all; > >the compiler does not give any errors, but the assignment does not work. >I looked at the assembly code and it seems that the compiler makes a call to >deep_finalize, deep_adjust but to no effect. > >Can someone explain how to get around this problem? >Thank you in advance. >Sincerely, >Jay S. > > > > >-----== Posted via Deja News, The Leader in Internet Discussion ==----- >http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum -- Martin C. Carlisle, Computer Science, US Air Force Academy mcc@cs.usafa.af.mil, http://www.usafa.af.mil/dfcs/bios/carlisle.html DISCLAIMER: This content in no way reflects the opinions, standard or policy of the US Air Force Academy or the United States Government.