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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1fa85f3df5841ae1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada.Containers.Vectors - querying multiple elements Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <426e4c2b$0$7515$9b4e6d93@newsread2.arcor-online.net> <0uYbe.542$BE3.229@newsread2.news.pas.earthlink.net> <1wjh6qsazg3rg$.lupowyuqu0tw$.dlg@40tude.net> <1O2dnYJF_uSxAejfRVn-2Q@megapath.net> <14ts2mrny7fci.emc3y6pqq7za$.dlg@40tude.net> Date: Thu, 5 May 2005 12:51:40 +0200 Message-ID: <1alsbsqw53l3o$.dud3ip2gd2m5$.dlg@40tude.net> NNTP-Posting-Date: 05 May 2005 12:51:41 MEST NNTP-Posting-Host: 0126b71a.newsread4.arcor-online.net X-Trace: DXC=RSKa==27B@DbkXRh2MA`7O:ejgIfPPldDjW\KbG]kaMHliQbn6H@_EIBdKn?hVbl9N[6LHn;2LCVNCOgUkn_?_YOVLX=NCU3W7F X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:10928 Date: 2005-05-05T12:51:41+02:00 List-Id: On 03 May 2005 19:30:29 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> I don't think that statistical approach is appropriate here. Anyway it >> makes an implementation of many generic algorithms and container libraries >> very difficult if possible. > > I don't see a big problem here. If you're counting things, use signed > integers, and start counting at zero or one. If you're using enums or > modulars, you're not "counting", and zero-length arrays/vectors/whatever > make no sense. Come on, empty set appear *before* number and arithmetic. Further, to be countable is much weaker than to be ordered. In an imaginary, better Ada there should be unordered, uncountable types which would still allow containers. There would be no way to enumerate elements in such container, but for any given X it would be possible to Is_In (X, C). Even for such weak types there should be empty containers such that Is_In returns false for any X. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de