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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d6fce62235e109c0 X-Google-Attributes: gid103376,public From: David Wallace Subject: Re: Can you help with an Ada 95 OO Problem Date: 1997/01/19 Message-ID: #1/1 X-Deja-AN: 210859707 distribution: world references: followup-to: comp.lang.ada organization: ArgoNet, but does not reflect its views reply-to: David Wallace newsgroups: comp.lang.ada Date: 1997-01-19T00:00:00+00:00 List-Id: Thanks for your reply Mathew, On Sat 18 Jan 97 (20:26:24), mheaney@ni.net wrote:# > >Try a view conversion of the designated object, to get at its primitive >operation: > > Http.Headers.Init (Obj => Http.Headers.Header (Header_Ref.all)); > >I'm not sure that will work, but try it and let me know (so I can >learn, too!). > I had tried your suggestion above, but this will not work either. Since the Init operation has an access parameter, it can only be passed an access type, but giving the components of the object direct visibility. This is why I had tried using the type conversion Headers_Access on the access parameter procedure Init (Obj : access General_Header) is Header_Ref : Header_Access(Obj); begin -- -- I thought that by doing the view conversion with the acces type, -- the tag would be changed on the class wide type. But on -- Investigation I found that this was not the case, the tag for the -- class wide type, would stay the same (In John Barnes Ada 95 book). -- This was when I really found myself stumped. -- -- The problem is made more difficult using the access parameter, which -- insists on an allocated access_type being passed in. I think it -- would be an easier problem to understand if it were not an access -- parameter. -- Init(Obj => Header_Ref); end Init; If you have any further Ideas, please do not hesitate to reply again. I am still reading the text books to try and find out, but would still appreciate help. Thanks Dave Wallace. -- --. --. --. --. : : --- --- .---------------------------------------------. |_| |_| | _ | | | | |_ | |Internet provider for all Acorn RISC machines| | | |\ | | | | |\| | | '---------------------------------------------' | | | \ |_| |_| | | |__ | averon@argonet.co.uk