comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex R. Mosteo" <devnull@mailinator.com>
Subject: Re: Normalize_Scalars
Date: Thu, 08 Feb 2007 11:43:30 +0100
Date: 2007-02-08T11:43:30+01:00	[thread overview]
Message-ID: <530d71F1q04boU1@mid.individual.net> (raw)
In-Reply-To: m2fy9h7h36.fsf@grendel.local

Simon Wright wrote:

> "Alex R. Mosteo" <devnull@mailinator.com> writes:
> 
>> Maciej Sobczak wrote:
>>
>>> gautier_niouzes@hotmail.com wrote:
>>>> BTW
>>>> - it seems that Normalize_Scalars is in Ada 95, Initialize_Scalars is
>>>> GNAT-only.
>>> 
>>> Portable code? :-)
>>> 
>>> But to be frank, I'm fine with GNAT-only Initialize_Scalars. Thank you
>>> for pointing me in this direction.
>>
>> But bear in mind they do opposite things!
> 
> ?
> 
> Normalize_Scalars: "This pragma ensures that an otherwise
> uninitialized scalar object is set to a predictable value, but out of
> range if possible.' (ARM95)
> 
> Intialize_Scalars: "This pragma is similar to Normalize_Scalars
> conceptually ..." (GNATRM)

Mmmm I had the following idea about them:

Normalize_Scalars should tries to cause an exception as soon as possible,
because it initializes to an /invalid/ value.

ITOH, Initialize_Scalars will use a /valid/ value for the initialization.

So the former should expose bugs and the latter hide them, for programs that
don't do proper initializations.

But I've seen after your warn that Initialize_Scalars is tailored by the user,
so my remembrances can come from a particular use of this pragma...



      reply	other threads:[~2007-02-08 10:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 13:33 Normalize_Scalars Maciej Sobczak
2007-02-07 13:59 ` Normalize_Scalars gautier_niouzes
2007-02-07 14:15   ` Normalize_Scalars gautier_niouzes
2007-02-07 14:43     ` Normalize_Scalars Maciej Sobczak
2007-02-07 15:36       ` Normalize_Scalars gautier_niouzes
2007-02-07 15:36       ` Normalize_Scalars Alex R. Mosteo
2007-02-07 22:12         ` Normalize_Scalars Simon Wright
2007-02-08 10:43           ` Alex R. Mosteo [this message]
replies disabled

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