comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@adaos.worldonline.co.uk>
Subject: Re: List container straw man (NJR V4)
Date: Sat, 17 Nov 2001 23:44:27 -0000
Date: 2001-11-17T23:44:27+00:00	[thread overview]
Message-ID: <9t6srq$nbro$4@ID-25716.news.dfncis.de> (raw)
In-Reply-To: 3BF6CCD6.F7195928@acm.org

"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3BF6CCD6.F7195928@acm.org...
> ...
> This is difficult to understand. This is the only place I've ever seen
> the concept of "cursorage"; it is certainly not a standard list concept.
> Combining the indexed operations and the cursor-based operations is
> called control coupling and makes the operations difficult to
> understand.

The word 'cursorage' is my own Carrollean invention. Feel free to improve
upon it.

As for the combination of offset and cursor-basing, I shall undo this
combination, to produce separate sets of subprograms (as, in fact, I had
before).

> The use of undefined types is confusing. I suppose they're declared in
> the parent package, but since we can't see the parent package it's still
> confusing.

[Smacks forehead] Sorry! I'll put the base package into the picture.

> The use of an abstract type and operations followed by a non-abstract
> extension and non-abstract operations doubles the size of the
> specification without adding any value that I can see. Every concrete
> list is going to have to declare and implement every operation, so
> declaring them abstract an additional time seems like a waste of time.

There are good reasons for having an abstract base. Avoiding extra code is
not a good reason for getting rid of it.

However, your comments have prompted me to re-evaluate putting the concrete
in with the abstract. I think I must remove it (to childerhood). The idea
was to avoid a further instantiation (since a child package must be
generic), but imposing a concrete type on any would-be list (derived from
Abstract_List) is too mauch baggage. Shame: we're back to two
instantiations; it seems hard to get away from them!

> Is_Empty and Length are basic list operations that are missing.

Oops! In they go. (Got lost in the rush.)

> A component should not raise predefined exceptions such as
> Constraint_Error. Use meaningful exceptions such as Cursor_Is_Null.

For some conditions, yes. Will do.

> A concrete implementation should document the time complexity of every
> operation, so the client can make appropriate choices of operations.
> ...
> Each operation should document its pre- and post-conditions, where
> applicable. Each operation should document what exceptions it may raise
> and under what circumstances; since exceptions are generally indications
> that the client has violated a precondition, the documentation for
> preconditions is usually a good place to document exceptions.

Okay. I said the documentation was brief! I'll add this stuff ASAP.

> With some more work this could be an acceptable standard specification.

Cool!

--
Best wishes,
Nick Roberts






  reply	other threads:[~2001-11-17 23:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-16  0:14 List container straw man (NJR V4) Nick Roberts
2001-11-17 18:22 ` Nick Roberts
2001-11-17 19:26   ` Stephen Leake
2001-11-17 23:30     ` Nick Roberts
2001-11-17 20:47   ` Jeffrey Carter
2001-11-17 23:44     ` Nick Roberts [this message]
2001-11-20 19:39       ` Mark Lundquist
2001-11-19 17:14   ` Ted Dennison
2001-11-22  3:18     ` Nick Roberts
replies disabled

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