From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 18 Aug 93 22:30:47 GMT From: agate!spool.mu.edu!sol.ctr.columbia.edu!emory!europa.eng.gtefsd.com!darwi n.sura.net!source.asset.com!cernosek@ucbvax.Berkeley.EDU (Gary J. Cernosek) Subject: Re: OO Preprocessor for Ada Message-ID: <1993Aug18.223047.21260@source.asset.com> List-Id: In article rowe@cs.uiuc.edu (Kenneth E. Rowe) writes: > >...stuff deleted >> >> with X, Text_IO; >> procedure Some_Client is >> An_Object : X.Object; >> P : Integer; >> begin >> X.Create (Instance => An_Object, P1 => 7); >> X.Modify (An_Object, P1 => 3); >> P := X.P1 (An_Object); >> Text_IO.Put ("The value of P1 is: "); >> Text_IO.Put ( Integer'IMAGE(P) ); > ^^^^^^^^^^^^^^^^ >Since X.Object is a tagged limited private type, can you >actually do an Integer'IMAGE on P? Note that I am simply taking the 'IMAGE of an object P, which is itself of type Integer. P is assigned the result of the selector call, seen a couple of lines before the one in question. Since the function X.P1 returns a value of type Integer, this statement is OK. But you're right, one cannot take the 'IMAGE of a private object. Note that I could have eliminated the local variable P altogether: Text_IO.Put ( Integer'IMAGE (X.P1(An_Object) ) ); One could argue about which style is more "readable;" but in any event, the 'IMAGE attribute must be applied to an Integer-typed value. -- Gary J. Cernosek Fastrak Training Inc. Houston Office: (713) 280-4768 E-mail: cernosek@source.asset.com