comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: List container straw man (NJR V4)
Date: 17 Nov 2001 14:26:12 -0500
Date: 2001-11-17T19:28:35+00:00	[thread overview]
Message-ID: <ug07drygb.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 9t69pc$jh6l$2@ID-25716.news.dfncis.de

"Nick Roberts" <nickroberts@adaos.worldonline.co.uk> writes:

> Okay, I've popped my own proposal on a web site:
> 
> http://www.adaos.ukf.net

Excellent.

Please add a pointer to my proprosal:
http://users.erols.com/leakstan/Stephe/Ada/sal.html 

Also to PragmArc:
http://home.earthlink.net/~jrcarter010/pragmarc.htm

You might want to distinguish between more or less complete libraries
(all except yours and Ted's), and strawman proposals.

I suggest making the number of cursors a generic formal parameter,
with a default of 8.

The documentation does not discuss the rationale for using an abstract
base type. This is an important design decision; it should be clearly
justified (and I know it's important to you). 

I'm not clear which element this function returns:

function Element
   (Source : in Abstract_List;
    Base   : in Base_Designator := 1;
    Facing : in Direction       := Forward;
    Offset : in Integer         := 0)
   return Element_Type is abstract;

The doc says Base = 1 means cursor 1, and Offset = 0 means the
position "at" the cursor. But a cursor is between elements. So I think
you need to say "after the cursor, in direction specified by Facing".

This function can raise some exception if the cursor is null or after the
end of the list; the spec should say what exception.

I find the mixed meaning for Base too confusing (Base = 0 means Offset
is absolute, Base > 0 means offset is relative to that cursor). I'd
prefer two functions, one with a Cursor parameter, and one without. It
took me a while to figure out how to access an element via a cursor.
Then you can group the "cursor-oriented" subprograms together, and the
"index-oriented" subprogams together.

I also have a quibble; please consider formatting the code as above.
That's the format used in the RM, and in GNAT. There's a function in
Emacs Ada-mode that will do the alignment of the parameters
automatically. My stuff uses that format. Hmm, Ted isn't using that
format either. I can't find a multiline subprogram spec in PragmaArc,
so I don't know what style Jeff might prefer. Corey's style is close
to yours. Well, we can argue style later!

-- 
-- Stephe



  reply	other threads:[~2001-11-17 19:26 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 [this message]
2001-11-17 23:30     ` Nick Roberts
2001-11-17 20:47   ` Jeffrey Carter
2001-11-17 23:44     ` Nick Roberts
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