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,2a34b7ad6c6a0774 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Efficiency of code generated by Ada compilers Date: Mon, 09 Aug 2010 17:38:49 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls4.std.com 1281389915 24547 192.74.137.71 (9 Aug 2010 21:38:35 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 9 Aug 2010 21:38:35 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:LzCxbDqiw0d6wYChFbITdg7dPYA= Xref: g2news1.google.com comp.lang.ada:13021 Date: 2010-08-09T17:38:49-04:00 List-Id: "Yannick Duch�ne (Hibou57)" writes: > Le Mon, 09 Aug 2010 19:59:45 +0200, a �crit: >> They are also subject to the possible error >> of failing to write the "mod" part, whereas with modular types the >> compiler has the responsibility to remember to do the mod operation. > DRY principle in action It's a good point. But you can get DRY without an implicit-mod type. For example, for a circular buffer, you can write a Next_Index function that does the explicit "mod", so you don't scatter "mod" ops all over the code. You don't need modular types for that. And you don't want any "*"-with-implicit-mod operator for the index. Nor do you want "xor" on the index. - Bob