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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a644fa9cd1a3869a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-13 07:49:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <3BECA3B7.5020702@telepath.com> <3BF0247D.4500975E@san.rr.com> <5BXH7.22252$xS6.34813@www.newsranger.com> <3BF052D3.ECEF3FF2@san.rr.com> Subject: Re: List container strawman 1.2 Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Tue, 13 Nov 2001 10:49:29 EST Organization: http://www.newsranger.com Date: Tue, 13 Nov 2001 15:49:29 GMT Xref: archiver1.google.com comp.lang.ada:16412 Date: 2001-11-13T15:49:29+00:00 List-Id: In article <3BF052D3.ECEF3FF2@san.rr.com>, Darren New says... > >Ted Dennison wrote: >> there is better. "Font" and "Back" are pretty standard terminology for list Hmmm. Reading this over, "Head" and "Tail" are actually more usual, aren't they? >OK, well, is the front of the list the first element? If so, why do they That's actually a very good question. It isn't an array, so you can't tell from that. The way the list is designed, I can use it as a queue or as a stack from either end and it will work just fine either way. The iterator, on the other hand, has a different job to perform. In its world, all it has to do is pick a side, and then go the other way until the end. So there it makes more sense to talk about "First" and "Last". However, you have to pick a side, and it would be useful to know how to relate the two. So you are right that this *is* a bit confusing, because somewhere you have to realise that "First"="Head". But renaming "Head" to "First" won't remove the confusion, because that term has no real meaning in the universe of Push'es and Pop's. So how do we get out of this. The best ways that I can see are either: o Make sure the iterator routines are well commented as to which directions in the "Head/Tail" world they operate. o Rename the iterator routines to match the other routines. Unfortunately, this would reqire "Next" and "Previous" to become something like "Next_Toward_Tail" and "Next_Toward_Head". The passive iterator would still have to be commented as to which direction it goes. I suppose a From_Head/From_Tail flag could be used instead. That might be useful anyway... I think the second option is quite doable, if that's what people really want. >It's not uncommon, usually when the sub-lists being inserted "mean" >different things, like you're inserting the children of the directory >after the directory entry during a breadth-first walk, say. And "&" has So what you are saying is that there is a hetrogenious structure to your list that isn't reflected in the structure of the list itself, but in the contents of the elements in the list (and thus has to be parsed back out)? You could accomplish this goal without the extra parsing (and without the middle insertion routine) by using lists of lists, could you not? You are right about the level-of-effort vs. the append routines, though. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.