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,3f2295ac59ed2cc0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-30 14:41:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!ppp-2-93.cvx4.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: List Container Straw Man (NJR V5R1) Date: Fri, 30 Nov 2001 22:05:51 -0000 Message-ID: <9u91u3$71h5k$1@ID-25716.news.dfncis.de> References: <9u6ahm$6gdc1$1@ID-25716.news.dfncis.de> <3C07BCEB.86878310@boeing.com> NNTP-Posting-Host: ppp-2-93.cvx4.telinco.net (212.1.149.93) X-Trace: fu-berlin.de 1007160068 7390388 212.1.149.93 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:17251 Date: 2001-11-30T22:05:51+00:00 List-Id: "Jeffrey Carter" wrote in message news:3C07BCEB.86878310@boeing.com... > Note that my comments on 7 > > "[list elements must not be private] List elements must be limited > private." > > are misleading, since they were made on the modified version > > "List elements must not be limited private" Sorry. What, then, is your comment on the requirement: List elements must be limited private. please? > As to mimicking Ada.Strings.*, abstract strings are a special case of > unbounded arrays, not of lists, as they don't provide O(1) insertion and > deletion. > > In order to be general, operations taking an array of elements would > have to be generic, so that the client may specify the array type. These > are easy enough for the client to implement with the basic operations, > so I doubt if they're worth the trouble of providing. I provided a specific array type, and corresponding insertion and replacement operations, primarily for situations where it would be particularly convenient for the programmer to construct an array aggregate. Supposing one wanted to append a specific gene sequence (to concoct an example) to a piece of DNA: Append( Seq_1, (Ad, Gu, Gu, Ad, Gu, Gu, Gu, Ad, Ad, Gu)); Doing this without the array type and operations would be less convenient, possibly less readable, and probably less efficient. An array of a different type (but with the same index and component types) can be converted: type Gene_Array is (Positive range <>) of DNA_Gene_Marker; package Gene_Lists is new SCL.Lists.Unbounded(DNA_Gene_Marker); use Gene_Lists; ... Extra_1: constant Gene_Array := (Ad, Gu, Gu, Ad, Gu, Gu, Gu, Ad, Ad, Gu); ... Append( Seq_1, Gene_Lists.Element_Array(Extra_1) ); Not pretty, but not too awful. But certainly the array type and operations are only a convenience feature, and could be removed without ruining the usefulness of the overall thing. -- Best wishes, Nick Roberts