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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9272170244740794 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-17 11:38:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: List container straw man (NJR V4) Date: 17 Nov 2001 14:26:12 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <9t1lp4$16unne$3@ID-25716.news.dfncis.de> <9t69pc$jh6l$2@ID-25716.news.dfncis.de> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1006025315 4214 128.183.220.71 (17 Nov 2001 19:28:35 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 17 Nov 2001 19:28:35 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16651 Date: 2001-11-17T19:28:35+00:00 List-Id: "Nick Roberts" 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