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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8309f2bc055237c4 X-Google-Attributes: gid103376,public From: Lao Xiao Hai Subject: Re: Bit manipulation Date: 2000/11/10 Message-ID: <3A0CD1A7.AE657E57@ix.netcom.com>#1/1 X-Deja-AN: 692290944 Content-Transfer-Encoding: 7bit References: <8u8v6n$b7o$1@nnrp1.deja.com> <2WTH$pdrCfOd@eisner.decus.org> <8ub6kt$6nd$1@nnrp1.deja.com> <8ubeq8$cgm$1@nnrp1.deja.com> <8ubhlh$ejv$1@nnrp1.deja.com> <8udaeu$8p$1@nnrp1.deja.com> X-Accept-Language: en X-Server-Date: 11 Nov 2000 05:02:11 GMT Content-Type: text/plain; charset=us-ascii Organization: MindSpring Enterprises Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-11-11T05:02:11+00:00 List-Id: Robert Dewar wrote: > > Very nicely put! Indeed the point here is to learn as much > about the problem as possible, so that the solution space can > be explored in the most effective manner. As you have pointed out many times Robert, Ada was never intended to be a convenient language for writing programs. It is more intended for responsibly communicating the intended goal of the program with the fewest errors. Ease of writing gives way to ease of reading. Ada is designed so most constructs are, by default, safe. Therefore, many convenient idioms common to less rigorous languages such as automatic type conversion, automatic promoting of a type, no checking at all on the mode or type of a parameter, etc., are avoided by Ada. On the other hand, it is quite possible to take a language in which the default for every construct is safe and relax the default to less safe. It is not as easy when the default is unsafe (e.g., C and, to a somewhat lesser extent, C++) to override that and make the code more safe. Bit manipulation is simply not that difficult in Ada. And it does not even require overrding the default safety of the language, especially in Ada 95. As has been noted in other postings, even Ada 83 provided straightforward solutions to this, albeit with the requirement that one abide by the rules of the language and make absolutely clear that what is being coded is exactly what is intended. Richard Riehle