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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ad988eb0a9545c86 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-19 05:08:14 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!kilgallen From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Problem trying to implement generics. Message-ID: References: <9b6jtu$4is$2@taliesin.netcom.net.uk> <9b6m27$68e$1@taliesin.netcom.net.uk> <0JBB6.10484$FD1.1197250@news6-win.server.ntlworld.com> <9b7tce$laf$2@taliesin.netcom.net.uk> <3ADC4320.7ACA3DEC@averstar.com> <9bhoup$h9k$1@taliesin.netcom.net.uk> <3ADC7A79.8E853905@mindspring.com> <9bi4g4$97m$1@nh.pace.Organization: LJK Software Date: 19 Apr 2001 08:08:06 -0500 NNTP-Posting-Host: 216.44.122.34 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 987682093 216.44.122.34 (Thu, 19 Apr 2001 12:08:13 GMT) NNTP-Posting-Date: Thu, 19 Apr 2001 12:08:13 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:6993 Date: 2001-04-19T08:08:06-05:00 List-Id: In article <9bkfk4$6a2$1@nh.pace.co.uk>, "Marin David Condic" writes: > It seems to be a thing C programmers are more hung up on than is really > necessary. Certainly some domains use bit shifts more than others (writing > low level code for device drivers, etc., vs accounting software.) Thinking about device drivers I have written (not in C or Ada) it seems to me that bit shifting is most likely to be the "manual" operation used in low-level languages where the conceptually desired operation is not supported. For instance, if one has a numeric field that is supposed to be positioned three bits left in a register the low-level approach (at the source level) would be to "shift" and "or" it together with the other bits before setting it into the register. The conceptual operation is to store a field into a register-format record before setting it into a record. The Ada method is much more logical, except for those with lots of experience writing drivers in lesser languages.