comp.lang.ada
 help / color / mirror / Atom feed
From: nobody@REPLAY.COM (Anonymous)
Subject: Re: problem in changing Discriminants from access type
Date: 1998/05/12
Date: 1998-05-12T00:00:00+00:00	[thread overview]
Message-ID: <199805121338.PAA26341@basement.replay.com> (raw)
In-Reply-To: 35577418.0@news1.ibm.net


On Tue, 12 May 1998 00:56:15 +0200, "Gil Kaspi" <kaspi@ibm.net> wrote
asking about changing the discriminants of a value designated by an
access value. Both the responses I have seen appear to be wrong, though
in different ways.

The correct reason that this raises Constraint_Error is given in ARM
3.10 (9): "Similarly, if the object created by an allocator has
discriminants, the object is constrained, either by the designated
subtype, or by its initial value."

Thus, the object created by "new" is constrained, so its discriminant(s)
can not change. Attempting to change the discriminant(s) is an attempt
to violate a constraint, and so raises Constraint_Error, as Gil Kaspi
has discovered.

ARM 3.10(9) tells us something else useful about discriminants and being
constrained: all aliased objects are constrained.

Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"Son of a window-dresser."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/




      parent reply	other threads:[~1998-05-12  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-12  0:00 problem in changing Discriminants from access type Gil Kaspi
1998-05-11  0:00 ` Matthew Heaney
1998-05-11  0:00 ` Lowe Anthony A
1998-05-11  0:00   ` Matthew Heaney
1998-05-12  0:00 ` Anonymous [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