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,e8b01e86b2d0a470 X-Google-Attributes: gid103376,public From: fraser@synopsys.synopsys.com.com Subject: Re: how to do bit-wise operation on none modular types? Date: 1999/03/03 Message-ID: <7bk5u2$94p$1@remarQ.com>#1/1 X-Deja-AN: 450878622 References: <7bj7ti$4i@drn.newsguy.com> <7bjjck$25t7@news1.newsguy.com> X-Complaints-To: newsabuse@remarQ.com X-Trace: 920492802 KZBGBQC4S164892E1C usenet77.supernews.com Organization: Vegetarian Ada Programmers Newsgroups: comp.lang.ada Originator: fraser@titanic Date: 1999-03-03T00:00:00+00:00 List-Id: I nearly cried when smize@imagin.net said: >Do you get some advantage from the "more direct route" that compensates >for it being somewhat less clear? I would expect the type conversion >to be a "view conversion" (terminology check) and so not to require >a copy, so both code fragments would be equally efficient. Do you find 'X mod 16#1_0000#' less clear than 'X and 16#FFFF#' (or even 'My_Mod (X) and 16#FFFF#'? I'm quite the reverse. I'm glad that the bitwise operations on modular types are part of the language now, but they still seem, um, low level. I've recently written a couple of virtual machines for two wildly different purposes, and there was a lot of bit fiddling going on, but I did it almost exclusively with "/" and "mod", even though I was looking at modular types. I suddenly wonder if I was wrong. Oh, my. Fraser. (avoiding low level operations on a virtual machine code emulator -- maybe I _am_ fooling myself :)