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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,75f02dbbddbbdc88 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.212.232 with SMTP id nn8mr6238451pbc.1.1323990007131; Thu, 15 Dec 2011 15:00:07 -0800 (PST) Path: lh20ni26885pbb.0!nntp.google.com!news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news-transit.tcx.org.uk!rt.uk.eu.org!border4.nntp.ams.giganews.com!Xl.tags.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 15 Dec 2011 16:59:54 -0600 User-Agent: NewsTap/3.5.1 (iPad) From: Martin Dowie Newsgroups: comp.lang.ada Mime-Version: 1.0 Message-ID: <1672239849345682435.876199martin-re.mo.ve.thedowies.com@news.btinternet.com> Subject: Re: Pop function References: <778917968345601399.621922martin-re.mo.ve.thedowies.com@news.btinternet.com> Date: Thu, 15 Dec 2011 16:59:54 -0600 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-c2ChrhkOWoZZbsA6AqrwEFi7rv3XwP9h6C+I3sUdfb4gfecJvz41kdkH3XNpKSFNHQBqlO9gGUHUvcp!q6O3biTZ2gEUPmCvQ5J5n+MVHpCj9X7TVWiIv5bh+tItPTl9DiQgScJiDXCksCRhWBDvmApaLUnv!56VA/0JPOV0pU0DZz/pQneYD6XghOW9EN4xqvcAJt/IF6Q== X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2908 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2011-12-15T16:59:54-06:00 List-Id: Adam Beneschan wrote: > On Dec 14, 4:29 pm, Martin Dowie > wrote: >> "Rego, P." wrote: >>> Hello, >> >>> Given a list type >>> type T_List is >>> record >>> Next : access T_List; >>> Item : Integer; >>> end record; >>> T_List_Ptr is access T_List; >> >>> Is it right to implement a pop function like the following? (Free is an >>> Unchecked_Deallocation) >>> function Pop (Sender : access T_List) return Integer is >>> Current_Sender_Ptr : T_List_Ptr := T_List_Ptr (Sender); >>> Current_Item : constant T_List := Sender.Item; >>> begin >>> if Sender /= null then >>> if Sender.Next /= null then >>> Current_Sender_Ptr := T_List_Ptr (Current_Sender_Ptr.Next); >>> end if; >>> Free (Current_Sender_Ptr); >>> return Current_Item; >>> else >>> return 0; >>> end if; >>> end Pop; >> >>> I mean, if I set Current_Sender_Ptr := T_List_Ptr >>> (Current_Sender_Ptr.Next), it's equivalent to Sender := Sender.Next? >>> (which I could not do directly due to in this case it would not be >>> allowed an anonymous reference, right?) >> >> If Sender is null, your in trouble before you get to "begin". > > First it's "here" instead of "hear", now it's "your" instead of > "you're".......... > > :) > -- Adam Groan...I need a holiday...and glasses...and 10 years taken off my age...and the kids to GO TO BED...and to really read what I'm writing (minor dyslexia doesn't help)...before I hit send! :-) -- Martin