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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail Subject: Re: Put the access value Newsgroups: comp.lang.ada References: <5e956327$0$1635$e4fe514c@news.kpn.nl> From: ldries46 Date: Tue, 14 Apr 2020 14:09:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: nl Message-ID: <5e95a814$0$1701$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 6d2893a3.news.kpn.nl X-Trace: G=MOtWiZ8n,C=U2FsdGVkX19+qtL07i9g6bgPzDFwo17+Cs8RWEI5DWW7iZEed7T/8FETK2h6b3J/SuFCQUN3VNx/F5uNIlnwE7xbIZE4rCQpotKMAWYuoiU= X-Complaints-To: abuse@kpn.nl Xref: reader01.eternal-september.org comp.lang.ada:58358 Date: 2020-04-14T14:09:56+02:00 List-Id: Op 14-4-2020 om 13:05 schreef Jeffrey R. Carter: > On 4/14/20 9:15 AM, ldries46 wrote: >> >> type Buffer_Pointer is limited private; >> >>     type Block_Buffer is record >>        nr       : integer; >>        buf      : Item; >>        previous : Buffer_Pointer := null; >>        next     : Buffer_Pointer := null; >>     end record; >> >>        El  : Buffer_Pointer := LastBuffer; >>        El1 : Buffer_Pointer; >> >> I just want to see if the routing of thedifferent Buffer_Pointer's is >> correct so I thought Buffer_Pointer'Image(El) would show the value of >> The Pointer El f.i. ?x000000 for null or even the simpel decimal >> value 0. > > 1. There are no access types in this code. The declaration of type > Block_Buffer is invalid because null cannot be a valid visible value > of type Buffer_Pointer > > II. Assuming the full type of Buffer_Pointer is an access type, and > the declaration of Block_Buffer can see the full type, it appears you > are creating a linked list. Why not use > Ada.Containers.Doubly_Linked_Lists? > > C. Assuming you're still going to use access types, why are you > interested in the internal representation of access values? These will > probably appear to be random values that provide no information, > except perhaps whether the value is null > > iv. If you're only interested in whether an access value is null or > not, this can be better determined without showing the internal > representation: > > "El is null " & Boolean'Image (El = null) > > "El is " & (if El = null then "" else "not ") & "null" > Thanks to mr J.P Rosen this worked and I have checked a Buffer random Buffer insert routinethat looked like it didn't work but I could see that it in fact worked correctly. I used the Ada Unchecked conversion. Mr Carter the Buffer_Pointer is an access  declaration which was limited private. And I just had presented it for the possibility that the problem should be created by its limited private pro