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: Samuel Mize Subject: Re: how to do bit-wise operation on none modular types? Date: 1999/03/04 Message-ID: <7bmn38$n0h@news1.newsguy.com>#1/1 X-Deja-AN: 451282551 References: <7bj7ti$4i@drn.newsguy.com> <7bjjck$25t7@news1.newsguy.com> <7bk5u2$94p$1@remarQ.com> Organization: ImagiNet Communications, Ltd. User-Agent: tin/pre-1.4-981002 ("Phobia") (UNIX) (AIX/3-2) Newsgroups: comp.lang.ada Date: 1999-03-04T00:00:00+00:00 List-Id: fraser@synopsys.synopsys.com.com wrote: > I nearly cried when smize@imagin.net said: Gosh, I didn't mean to upset you. Maybe you should speak to Niles. >>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. Depends on what you're doing. The original question referred to a "status" value. I've seen those (in C) as enumerated integers, and as bitmaps. For a bitmap, I prefer a syntax that makes it clear I'm viewing that value as a series of bits ("and"). For an integer, I'd use a syntax that makes it clear that I'm viewing the value as an integer ("mod"). Best, Sam Mize -- Samuel Mize -- smize@imagin.net (home email) -- Team Ada Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam