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,db88d0444fafe8eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news.germany.com!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Tue, 06 Sep 2005 17:51:11 +0200 From: Georg Bauhaus Organization: future apps GmbH User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050718 Debian/1.7.8-1sarge1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Surprise in array concatenation References: <1125544603.561847.32140@g47g2000cwa.googlegroups.com> <14muavojz308w.1ouv7xin79rqu$.dlg@40tude.net> <4318486f$0$24154$9b4e6d93@newsread4.arcor-online.net> <43187a50$0$24162$9b4e6d93@newsread4.arcor-online.net> <11p5i525v2q5d$.17ayuwvqhazo1.dlg@40tude.net> <431a00cb$0$2113$9b4e6d93@newsread2.arcor-online.net> <9s72daxfzb4f.1k7noh1qr5qpg.dlg@40tude.net> <431c465d$0$24150$9b4e6d93@newsread4.arcor-online.net> <79fcfodixv3k$.1m7d28joczncs$.dlg@40tude.net> <431c8c35$0$2101$9b4e6d93@newsread2.arcor-online.net> <3ufj318nkubi.a5j4dbvaofhc.dlg@40tude.net> <431d82e3$0$24147$9b4e6d93@newsread4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <431dbabc$0$24153$9b4e6d93@newsread4.arcor-online.net> NNTP-Posting-Date: 06 Sep 2005 17:50:20 MEST NNTP-Posting-Host: 1a0ccf95.newsread4.arcor-online.net X-Trace: DXC=_8JLQ[18>Y3h^:`T28h7Q<:ejgIfPPld4jW\KbG]kaM8ea\9g\;7Nm5N[8a6bVc9h?UUng9_FXZ=3>:=P9Ihe`B8@Z?dZ]MOid5 X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:4476 Date: 2005-09-06T17:50:20+02:00 List-Id: Dmitry A. Kazakov wrote: > On Tue, 06 Sep 2005 13:52:53 +0200, Georg Bauhaus wrote: > > >>If the world is logical, as you claim, then our sentences >>cannot be illogical, thus our sentences must be proper >>propositions, thus decidable. > > > OK, see mathematical type theory (starting for Russel & Whitehead) (And hope to see what? There is no way out, we can only agree on something. Mathematics declares the swamp away into which it is built, and says so. But there are swamps in the problem domain.) > The violation is in inability to construct empty arrays and ranges for some > types. Many kinds of structured data cannot be constructed from Ada's types because of Ada's rules. How does this violate Ada's contracts? A contract is not necessarily simple, nor without deliberately chosen limitations. > That becomes funny. What is a "finite" value? Is 1/3 finite? What about > 0.1? (:-)) Earlier I said, forget about real numbers (from mathematics) in real computers. 1/3 is indeed an example in binary computers: An interval representing two real numbers close to 1/3 is not 1/3, and you cannot hope to be computing using real numbers using the facilities of a real computing machine. That is because almost all reals cannot be represented in a finite computer. The problem cannot in general be solved by using intervals. For example, try to approximate 1/3, using the analog of my fly-hits-windshield example. That is, represent all numbers required for such a computation, and compare them. > LOL! Any program represents anything symbolically. No, an executing program has an interpretation. This makes "representing" have a meaning. An explosion (triggered by a signal coming through a cable plugged into a computer outlet) is itself not a symbol that stands for something else. Neither is The signal. You can have a bit pattern standing for the explosing, thus a symbol. But a symbol is finite, and there can only be finitely many in any computation in a real computer. > Do you really believe > that 1 is *the* 1? Did you see a label "made in Heaven" on it? (:-)) Type Positive starts at 1 and ends with Positive'Last. Ignoring the literal 1 distraction for the moment, the phrase "counting the value-elements in type Positive" has meaning. In real Ada programs, the count is always finite. Here is a type of cardinality 1: > type Infinite is (Infinity); This is a finite type, obviously. For it's intended meaning as fooling us into believing that a real computer could represent infinite types, see my fly-windshield example. Similarly, (the set of) universal integers can only be finite inside the computer. If your program is to pick just any, not one particular that happens to be small enough, the limit is the same. >>>Presently the case A'Last < A'First is used to indicate that there >>>is no bounds. >> >>That's wrong, in that it just indicates that A'Last < A'First yields >>an empty range. > > > The way how the operation ".." is defined on its operands has nothing to do > with existence of bounds of the result. The index values A'First etc. of an array always exist. The elements might not exist. This is consistent with how Ada is defined, AFAICT, and it is consistent with the definitions in programming languages, and libraries. It is also considered useful by many. >>>It is a quite silly way to handle errors. Instead of an >>>immediate response you return nonsensical values >> >>What nonsensical values are returned in text like "3 .. 1"? > > > Nothing. 3 and 1 are literals. A'First and A'Last aren't. What nonsensical values are returned in text like "A'First .. A'Last" when A'First > A'Last? The fact that A'First doesn't always refer to an element is not different from the fact that A'Length / 2 doesn't always refer to an element, even when the array isn't empty. Of what use is the test A'Length = 0 in this case?