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-Thread: 103376,229ea0001655d6a2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Generic Package References: <1177539306.952515.222940@s33g2000prh.googlegroups.com> <1177601484.444701.171560@r35g2000prh.googlegroups.com> <9eejm6rqip.fsf@hod.lan.m-e-leypold.de> <19qllkvm6ut42$.1iqo74vjgmsrv$.dlg@40tude.net> <1177801611.10171.32.camel@localhost.localdomain> <1woad6hn9idy2$.6otnwphc1o0h$.dlg@40tude.net> <1177929029.6111.34.camel@localhost> <1177944533.13970.17.camel@localhost> <2aq08qbvw0ym$.1rquampzo7o53.dlg@40tude.net> <1ieq3io2d6nnq$.13818v3y35gnr.dlg@40tude.net> <1178010142.6695.29.camel@localhost.localdomain> <1178026941.16837.88.camel@localhost.localdomain> <1ozvzzh59ebq8$.yeh9do8s3hig$.dlg@40tude.net> From: Markus E Leypold Organization: N/A Date: Wed, 02 May 2007 10:06:18 +0200 Message-ID: <40irbbzm2t.fsf@hod.lan.m-e-leypold.de> User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:mhtxITW+nUFdZABb42Ak1u8umxY= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.72.252.103 X-Trace: news.arcor-ip.de 1178092687 88.72.252.103 (2 May 2007 09:58:07 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news1.google.com!news4.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news1.google.com comp.lang.ada:15453 Date: 2007-05-02T10:06:18+02:00 List-Id: "Randy Brukardt" writes: > "Dmitry A. Kazakov" wrote in message > news:1ozvzzh59ebq8$.yeh9do8s3hig$.dlg@40tude.net... >> On Tue, 01 May 2007 15:42:21 +0200, Georg Bauhaus wrote: > ... >> > Yes, in the sense that the specifics of memory layout and such are >> > unknown and irrelevant to the client; in particular, no order needs >> > to be specified. >> >> Apart from obvious uselessness of contracts referencing to the memory >> layout, the above is self-contradictory. Memory layout defines an order. > It >> also is a part of the contract. Hence the interface is ordered. > > And now all is clear. No. The only thing that is clear to me, is, that DK is splitting hairs again, just to win the argument. > It is impossible to implement a set with having some form of order. So, for ^^^^^^^^^ Implement, yes. But it is possible to implement a set interface without forcing the user to provide an order function to instantiate the set. It is also possible to provide a mechanism for such an implementation that gives you all the elements in this set in some arbitary order/sequence which might change with every invocation. This is called iteration. DK originally stated, it is not possible to iterate over an unordered set: It is. It is possible to specify the contract for this iteration without referring to an order (I did it in one of my recent post). DK denied this. He is wrong. Implementing a set as a linked list might not be efficient enough for a large number of items -- still: It is a set in any sane sense and one can provide an interface to iterate over the items. And it has even been implemented without using an order defined on the elements of the set. So the even the statement "one cannot implement a set (with or without iteration) without providing an order over the elements" is plainly wrong. (And no: The linked list doesn't define an order on all possible elements of the set.) Regards -- Markus