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,36b302576d78847a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 20 Jul 2006 14:36:45 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 20 Jul 2006 14:36:45 -0500 NNTP-Posting-Host: 67.164.83.70 X-Trace: sv3-OxOAwR1mpP5YbmaSP7ZlUhpdgRGjjLGuVM2BLxR8US78J1FGKjAMQlhMHvNt5KyL/LjVOvVF4R1FSOr!dLRCi4U3OPo3ypwLdCUCNcAU34Ipf0GSU/RtzM74yGYZZRzHWslgeI8OOy1RFAL0E5N4PlrPhCb8!tDESMzpjq5xrTg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5843 Date: 2006-07-20T14:36:45-05:00 List-Id: >Why I use a modular type instead of a record with rep. clauses? More >practical. (And I think safer, I think rec. rep. clauses are not as >strongly required by the RM to be met by the implementation, which is If you really want to be portable to a compiler meeting the absolute minimum standard, then you are, of course, doing your own 64 bit arithmetic, since both Integer and System.Max_Binary_Modulus are only required to be 16 bits. Ada is designed to be highly readable and to aid in creating correct programs. Surely a record rep clause, and then simple usage of its components, is more readable, and more likely to be correct, and even more likely to generate optimized code, than source code littered with complex arithmetic expressions. When I used languages other than Ada, I thought of a compiler as a tool to convert my source code to binary. With Ada, though, I think of the compiler as an assistant, doing the scut work (like shifting and masking in this case) and watching to tell me of any obvious errors. It's a different world view.