comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon.j.wright@mac.com>
Subject: Re: String literals and wide_string literals - how?
Date: Sun, 22 Apr 2007 22:18:16 +0100
Date: 2007-04-22T22:18:16+01:00	[thread overview]
Message-ID: <m28xckds6f.fsf@mac.com> (raw)
In-Reply-To: 2oPWh.9599$n_.6781@attbi_s21

"Jeffrey R. Carter" <jrcarter@acm.org> writes:

> Simon Wright wrote:
>>
>> It may not be useful but in some applications it's essential to know.
>>
>> And it seems to me that a compiler that thought 2#00110011# was
>> acceptable probably wouldn't itself be acceptable.
>
> Why not? It adheres to the well defined and portable semantics Duff
> mentioned.

It just seems wilfully perverse, that's all. What other bizarre
decisions would the designers have made? Why choose software/hardware
that does that if there's a more reasonable alternative?

> My point was that these kinds of arrays are promoted as a better way
> to access individual bits than logical operations and shifts. But
> unless you have some definition of which bit "Y (Y'First)" accesses,
> they're not useful for that because they're extremely compiler
> dependent, while logical operations and shifts are portable across
> compilers and targets. Some sort of correspondence with the bit
> numbers used in record representation clauses would be OK.

I don't quite see the last sentence -- typically the bit numbering
depends on the endianness, very annoying -- not sure whether new Ada
sorts that one out.

For the rest, I quite agree; _much_ easier to map the C condition 
"(x & (1<<2))" to "(X and 2#00000100#) /= 0".



  reply	other threads:[~2007-04-22 21:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 10:07 String literals and wide_string literals - how? Gerd
2007-04-20 14:33 ` Adam Beneschan
2007-04-20 14:55 ` Robert A Duff
2007-04-20 19:16   ` Randy Brukardt
2007-04-20 20:01     ` Adam Beneschan
2007-04-20 20:41       ` Dmitry A. Kazakov
2007-04-20 20:02     ` Robert A Duff
2007-05-21  2:33       ` David Thompson
2007-05-22 22:32         ` Randy Brukardt
2007-05-23 18:42           ` Jeffrey R. Carter
     [not found]             ` <f324h5$fna$1@f04n12.cac.psu.edu>
2007-05-24 21:15               ` Jeffrey R. Carter
2007-05-23  2:27         ` Keith Thompson
2007-07-01  1:00           ` David Thompson
2007-05-23 12:28         ` brian.b.mcguinness
2007-04-20 20:48     ` Dmitry A. Kazakov
2007-04-20 22:09   ` Jeffrey R. Carter
2007-04-21  9:41     ` Simon Wright
2007-04-22  0:35       ` Jeffrey R. Carter
2007-04-22  9:45         ` Simon Wright
2007-04-22 20:15           ` Jeffrey R. Carter
2007-04-22 21:18             ` Simon Wright [this message]
2007-04-23  1:44               ` Jeffrey R. Carter
2007-04-22  1:00     ` Robert A Duff
2007-04-20 14:58 ` Georg Bauhaus
replies disabled

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