comp.lang.ada
 help / color / mirror / Atom feed
From: joe@petsd.UUCP (Joe Orost)
Subject: Re: Ambiguous use of dereference in Ada
Date: Wed, 24-Jul-85 10:41:11 EDT	[thread overview]
Date: Wed Jul 24 10:41:11 1985
Message-ID: <598@petsd.UUCP> (raw)
In-Reply-To: 38000019@gypsy.UUCP

In article <38000019@gypsy.UUCP> rosen@gypsy.UUCP writes:
>     ...
>     type stupid is 
>       record
>	 a: integer;
>	 b: float;
>       end record;
>     type stupid_ptr is access stupid;
>     c1, c2: integer;
>     xxx: stupid_ptr;
>  begin
>        c1 := xxx.a;		--1--
>        c2 := xxx.all.a;	--2--
>     ...

Some quotes from the bible:

	4.1.3(6)     (b) A component of a record:

	     (7)	The selector must be a simple name denoting a
			component of a record object or value.  The prefix
			must be APPROPRIATE FOR THE TYPE of this object or
			value.

	     (11)    (d) An object designated by an access value:

	     (12)	The selector must be the reserved word ALL.  The
			value of the prefix must belong to an access type.

	4.1(6)		A prefix is said to be APPROPRIATE FOR A TYPE in
			either of the following cases:

	   (7)		 o The type of the prefix is the type considered.

	   (8)		 o The type of the prefix is an access type whose
			   designated type is the type considered.

In your example, the first dereference is legal because of 4.1.3(7) & 4.1(8).
The second dereference is legal because of 4.1.3(12) & 4.1.3(7) & 4.1(7).

QED.

				regards,
				joe

--

 ........        .........	Full-Name:  Joseph M. Orost
 .       .       .		UUCP:       ihnp4!vax135!petsd!joe
 . ......   ...  ........	ARPA:	    vax135!petsd!joe@BERKELEY
 .               .		Phone:      (201) 758-7284
 .               .........	Location:   40 19'49" N / 74 04'37" W
				US Mail:    MS 313; Perkin-Elmer; 106 Apple St
					    Tinton Falls, NJ 07724

      reply	other threads:[~1985-07-24 14:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1985-07-22 14:06 Ambiguous use of dereference in Ada rosen
1985-07-24 14:41 ` Joe Orost [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