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.189.194 with SMTP id gk2mr5989444pbc.3.1323982929965; Thu, 15 Dec 2011 13:02:09 -0800 (PST) Path: lh20ni26576pbb.0!nntp.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news2.euro.net!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Pop function Date: Thu, 15 Dec 2011 21:02:09 +0000 Organization: A noiseless patient Spider Message-ID: References: <27517259.83.1323907586856.JavaMail.geo-discussion-forums@yqgn9> <1kofjewuvxn4n.xiil34dbjf9i$.dlg@40tude.net> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="27958"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181zPLxwtBsOjeFIW2n0jNrNwfIyQ7TQhE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:905j436WM27jzmtcWOVplTMOrDU= sha1:U6fbYrGDFbQZOS/CAJ5/PqwZGs8= Content-Type: text/plain; charset=us-ascii Date: 2011-12-15T21:02:09+00:00 List-Id: "Dmitry A. Kazakov" writes: > On Thu, 15 Dec 2011 12:57:47 -0700, Jeffrey Carter wrote: > >> On 12/15/2011 01:38 AM, Dmitry A. Kazakov wrote: >>> On Wed, 14 Dec 2011 17:34:57 -0700, Jeffrey Carter wrote: >>> >>>> Your public interface should never use access types. >>> >>> Yes, but since list as a data structure has the semantics of objects >>> accessed by references it would make sense to have this reflected in the >>> interface. But of course the list element must be >>> >>> type List_Item is access Integer; -- Only the data, no other mess >> >> No, a public interface should never use access types, ever. Hiding >> those is what abstraction is about. Any public interface that uses >> access types is poorly designed. > > In that case there should be no linked lists at all. A linked list is per > its definition a set of elements accessed using pointers. I don't think that using the word "linked" in the name is the same as "using access types in the abstraction"! I've seen linked lists that were implemented (under the hood) with indices into an array of items.