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,e55245590c829bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!news.astraweb.com!border2.a.newsrouter.astraweb.com!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: _Type vs no _Type Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.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: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <82lj5c5ecm.fsf@stephe-leake.org> <82zktq4n9b.fsf_-_@stephe-leake.org> <4cd53555$0$7665$9b4e6d93@newsspool1.arcor-online.net> <1hjbm9sq2q6v6.1o1jb481odeuh$.dlg@40tude.net> Date: Sat, 6 Nov 2010 15:53:46 +0100 Message-ID: NNTP-Posting-Date: 06 Nov 2010 15:53:44 CET NNTP-Posting-Host: 3eae2d16.newsspool1.arcor-online.net X-Trace: DXC=9YhRnIBKTB6_A0jCfgHO6>ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2jT0RSF^oPH<[6LHn;2LCV>[ On Sat, 06 Nov 2010 13:34:41 +0000, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > >> On Sat, 06 Nov 2010 12:00:38 +0100, Georg Bauhaus wrote: >> >>> On 11/6/10 8:12 AM, Dmitry A. Kazakov wrote: >>> >>>> Hmm, I would expect you arguing for >>>> >>>> function "/" (Dividend : T; Divisor : T) return T; >>>> >>>> For commutative operations like "+" it becomes a bit difficult: >>> >>> You aren't suggesting the computer-"+" is a commutative >>> operation, are you? >> >> I do. The implementation of "+" is not "strictly" commutative, but its >> interface does not tell that. The implied, not stated contract, is >> that "+" is indeed commutative allowing certain compiler >> optimizations. A numeric expression denotes a set of results >> satisfying certain conditions (accuracy constraints required by the >> ARM). Within these limits "+" is "weakly" commutative. > > One would very much _hope_ that these two would behave commutatively, of > course. > > function "+" (L : Time; R : Duration) return Time; > function "+" (L : Duration; R : Time) return Time; Yes, though neither of two is commutative. It would be nice if Ada supported class-wide operations defined on tuples, e.g. (imaginary syntax): function "+" (L : Time | R : Duration) return Time; a class-wide truly commutative operation defined on the anonymous class: { (Time, Duration), (Duration, Time) } -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de