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 Path: border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Integers and Mathematical Correctness Date: Thu, 02 Oct 2014 13:10:52 +0200 Organization: A noiseless patient Spider Message-ID: References: <7ab81f91-af1f-4fb1-8aef-c7f692e22f38@googlegroups.com> <72db10f1-7e12-4f8c-8ee5-c2bdce727c09@googlegroups.com> <34da5a39-9fa3-4e8e-a3f9-98f61a4ebcc7@googlegroups.com> <1vtp35phxa6d9$.ni9xlewi7r5v.dlg@40tude.net> <86b50b2e-57ad-47f3-bdaf-b98abcb722be@googlegroups.com> <9ae867ea-50da-40ef-bd56-3d6dd62d34e6@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 2 Oct 2014 11:10:52 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="26641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AM7lxCMi835na5Pox5CYQJIT0O2F6OpQ=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <9ae867ea-50da-40ef-bd56-3d6dd62d34e6@googlegroups.com> Cancel-Lock: sha1:WfYlCY0W3CYgPb282cKKLE4sCEI= Xref: number.nntp.giganews.com comp.lang.ada:189302 Date: 2014-10-02T13:10:52+02:00 List-Id: On 01.10.14 21:48, vincent.diemunsch@gmail.com wrote: > But now that we have operator overloading and that I use it for rationals or symbolic expression, I am bothered that an integer division has exactly the syntax I would like to use for a rational number... A story about John von Neumann has him say something like "what a waste of valuable programmer time", when approached by someone enthusiastically demonstrating early Fortran syntax, assuming that source texts looking "like math" rather than "like assembler" would help. In fact, I think that, provided that one is using languages not specifically made for mathematics, distracting peoples' attention from computing devices by way of "math like" syntax is a terrible mistake. It is the prime invitation to not think about the thing you are programming, and then make corresponding mistakes, led by the wrong assumptions. Computer formalisms deserve their own syntax. It does not make them non-mathematical. Operators that are not operating like the ones you learned at school should never look like those. Cf. C's INT_MAX + 1 ... or feed the following program to GNAT's default compilation to watch "+" in action: procedure Plus is X : Integer := Integer'Last; begin for Y in Integer loop X := X + 1; end loop; end Plus;