comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Mize <smize@imagin.net>
Subject: Re: how to do bit-wise operation on none modular types?
Date: 1999/03/04
Date: 1999-03-04T00:00:00+00:00	[thread overview]
Message-ID: <7bmn38$n0h@news1.newsguy.com> (raw)
In-Reply-To: 7bk5u2$94p$1@remarQ.com

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




  reply	other threads:[~1999-03-04  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-03  0:00 how to do bit-wise operation on none modular types? bill
1999-03-03  0:00 ` Tucker Taft
1999-03-03  0:00   ` Samuel Mize
1999-03-03  0:00     ` dennison
1999-03-03  0:00     ` fraser
1999-03-04  0:00       ` Samuel Mize [this message]
1999-03-05  0:00         ` fraser
1999-03-04  0:00       ` dennison
1999-03-03  0:00     ` Tucker Taft
1999-03-04  0:00       ` robert_dewar
1999-03-05  0:00         ` bourguet
1999-03-05  0:00           ` robert_dewar
1999-03-04  0:00       ` Tom Moran
1999-03-04  0:00         ` fraser
1999-03-03  0:00 ` Tarjei Tj�stheim Jensen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox