From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3f267467312181f1 X-Google-Attributes: gid103376,public From: nobody@REPLAY.COM (Anonymous) Subject: Re: problem in changing Discriminants from access type Date: 1998/05/12 Message-ID: <199805121338.PAA26341@basement.replay.com>#1/1 X-Deja-AN: 352538944 Content-Transfer-Encoding: 7bit References: <35577418.0@news1.ibm.net> X-001: Replay may or may not approve of the content of this posting X-002: Report misuse of this automated service to X-URL: http://www.replay.com/remailer/ Content-Type: text/plain; charset=us-ascii Organization: Replay Associates, L.L.P. Mail-To-News-Contact: postmaster@nym.alias.net Newsgroups: comp.lang.ada Date: 1998-05-12T00:00:00+00:00 List-Id: On Tue, 12 May 1998 00:56:15 +0200, "Gil Kaspi" 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/