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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Put the access value Date: Tue, 14 Apr 2020 13:05:18 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <5e956327$0$1635$e4fe514c@news.kpn.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 14 Apr 2020 11:05:20 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="4d4a0f38a0c28311a45dd0169172d2cf"; logging-data="15185"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18npToyfiU/P7gKhAbPilu/hWHedUmd9Mw=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cancel-Lock: sha1:uh3ItwvnzstcuLC4oevQQi2QP20= In-Reply-To: <5e956327$0$1635$e4fe514c@news.kpn.nl> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58357 Date: 2020-04-14T13:05:18+02:00 List-Id: 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" -- Jeff Carter "Your mother was a hamster and your father smelt of elderberries." Monty Python & the Holy Grail 06