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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: Magic ordering Date: Tue, 15 Mar 2005 13:53:50 +0000 Organization: Cuivre, Argent, Or Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <42309456$1@news.broadpark.no> <4232ab3a$0$26547$9b4e6d93@newsread4.arcor-online.net> <1110888090.283361.113590@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1110894849 19395 212.85.156.195 (15 Mar 2005 13:54:09 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 15 Mar 2005 13:54:09 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: mailbox@dmitry-kazakov.de Return-Path: In-Reply-To: X-Mailer: Apple Mail (2.619.2) X-OriginalArrivalTime: 15 Mar 2005 13:53:52.0664 (UTC) FILETIME=[6C14E980:01C52966] X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:9439 Date: 2005-03-15T13:53:50+00:00 On 15 Mar 2005, at 13:16, Dmitry A. Kazakov wrote: >>> ... If I am denied access to information that >>> lets me implement a < operator, am I supposed to be able to sort it? >> >> This is one of my favourites. There's always a way. Bit by bit >> comparison, an arbitrary index, 'Address comparison... > > All of which might appear wrong. The objects might be non-contiguous, > have > replicas etc. Note that you *know* they are non-contiguous, have replicas, etc. then you *have* the required information. > Comparison should reflect the semantics of compared things. If you mean *deep* semantics, then not necessarily. I've come across many situations where the order does not (need to) reflect it. A strictly algebraic order is enough. For example ordering a set of integers for search (e.g. in an Ada.Containers.Ordered_Set). The deep meaning of the integers does not matter. They can be SS numbers, or IP addresses, or the height of people. However you can still get something useful from the container, e.g. "is it there?" > There is no universal way to do it. I don't claim there is an "universal" way, but that there is always one. Ok, maybe theoretically any usable information may be missing. But in practice this is an anomalous situation. If you need an order for some type, then certainly you have same usable information. Either the (deep) meaning of the type, or some structural property, or some reliable representation. If all these are missing, and you still need an order, the design must be at fault.