comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Pop function
Date: Thu, 15 Dec 2011 14:25:50 -0700
Date: 2011-12-15T14:25:50-07:00	[thread overview]
Message-ID: <jcdokv$fbd$1@adenine.netfront.net> (raw)
In-Reply-To: <m2ehw58s6m.fsf@pushface.org>

On 12/15/2011 02:02 PM, Simon Wright wrote:
> "Dmitry A. Kazakov"<mailbox@dmitry-kazakov.de>  writes:
>
>> On Thu, 15 Dec 2011 12:57:47 -0700, Jeffrey Carter wrote:
>>
>>> 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.

Precisely. That's a bounded list; see PragmARC.List_Bounded_Unprotected for an 
example.

And see Ada.Containers.Doubly_Linked_Lists for an example of an unbounded list 
abstraction with no visible access types.

-- 
Jeff Carter
"I would never want to belong to any club that
would have someone like me for a member."
Annie Hall
41

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---



  reply	other threads:[~2011-12-15 21:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15  0:06 Pop function Rego, P.
2011-12-15  0:29 ` Martin Dowie
2011-12-15  1:23   ` Rego, P.
2011-12-15  2:08   ` Adam Beneschan
2011-12-15 22:59     ` Martin Dowie
2011-12-16 10:27       ` georg bauhaus
2011-12-15  0:34 ` Jeffrey Carter
2011-12-15  1:35   ` Rego, P.
2011-12-15  2:55     ` Alex Mentis
2011-12-15  3:00       ` Alex Mentis
2011-12-15  3:00     ` Jeffrey Carter
2011-12-15  3:41       ` Rego, P.
2011-12-15  8:38   ` Dmitry A. Kazakov
2011-12-15 19:57     ` Jeffrey Carter
2011-12-15 20:15       ` Dmitry A. Kazakov
2011-12-15 21:02         ` Simon Wright
2011-12-15 21:25           ` Jeffrey Carter [this message]
2011-12-16  8:23           ` Dmitry A. Kazakov
2011-12-16  0:31       ` Randy Brukardt
2011-12-15  2:06 ` Adam Beneschan
2011-12-15  3:27   ` Rego, P.
2011-12-15 12:43     ` Simon Wright
2011-12-15 15:54       ` Adam Beneschan
2011-12-15 18:34         ` Simon Wright
2011-12-15 19:14           ` Dmitry A. Kazakov
2011-12-15 16:14     ` Adam Beneschan
2011-12-28 13:04       ` Rego, P.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox