comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Prevalence of Compilers for Which Integer'Size < 32?
Date: 1996/08/03
Date: 1996-08-03T00:00:00+00:00	[thread overview]
Message-ID: <dewar.839076864@schonberg> (raw)
In-Reply-To: 31FF5CF0.5C13@lmtas.lmco.com


Ken said

"Considering I had to start with "anInt32", I didn't really worry about
the clarity of the named number name! Of course, Word_Length_In_Bits is
also horrible if (a) you're declaring multiple types with
different widths in the same package and/or (b) the software might
be used somewhere where the machine word wasn't 32 bits."


You missed my point, case (b) is *exactly* the case where the name
Word_Length_In_Bits might be appropriate if that is what you really
want. Of course if you use the software somewhere where the machine
word is not 32-bits, then you would have to modify this declaration.

Ada code can be made to be automatically portable most of the time, but
not necessarily all the time, since the predefined set of attributes is
not necessarily powerful enough to parametrize everything you want.
In this particular case, if you really wanted the machine word size
to govern the length of the type, you could probably use
System.Word_Size (or in GNAT Standard'Word_Size) and completely avoid
the dreaded 32, in the declaration as *well* as in the name.





  parent reply	other threads:[~1996-08-03  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-26  0:00 Prevalence of Compilers for Which Integer'Size < 32? Dave Marshall
1996-07-27  0:00 ` steved
1996-07-28  0:00   ` Dave Marshall
1996-07-28  0:00     ` Robert A Duff
1996-07-28  0:00       ` Robert Dewar
1996-07-29  0:00         ` Robert A Duff
1996-07-28  0:00     ` Robert Dewar
1996-07-28  0:00     ` steved
1996-07-28  0:00   ` Robert A Duff
1996-07-30  0:00     ` Ken Garlington
1996-07-30  0:00       ` Robert Dewar
1996-08-01  0:00         ` steved
     [not found]         ` <31FF5CF0.5C13@lmtas.lmco.com>
1996-08-03  0:00           ` Robert Dewar [this message]
1996-08-07  0:00             ` Ken Garlington
  -- strict thread matches above, loose matches on Subject: below --
1996-07-28  0:00 tmoran
1996-07-29  0:00 ` John Herro
replies disabled

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