comp.lang.ada
 help / color / mirror / Atom feed
* anonymous array types and record components
@ 1986-02-12  1:54 Doug Bryan
  1986-02-17 12:50 ` jankok
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Bryan @ 1986-02-12  1:54 UTC (permalink / raw)



Hi all...

One of my students asked me a question the other day that I could not
answer.  Since this does not happen too often, I got out a few reference
books and started digging.  I still don't have a good answer!  Here is
the question...

	X : array (1 .. 10) of Integer;

Using an anonymous array type for an object declaration is valid.

	type R is record
	    X : array (1 .. 10) of Integer;
	  end record;

Using an anonymous array type for the component of a record is invalid.
Why?  What is the rational for disallowing anonymous array types
for record components?

Any hints would be appreciated.

doug bryan
-------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: anonymous array types and record components
  1986-02-12  1:54 anonymous array types and record components Doug Bryan
@ 1986-02-17 12:50 ` jankok
  0 siblings, 0 replies; 2+ messages in thread
From: jankok @ 1986-02-17 12:50 UTC (permalink / raw)


In article <8602120210.AA01239@ucbvax.berkeley.edu> info-ada@ucbvax.UUCP writes:
>the question...
>
>	X : array (1 .. 10) of Integer;
>
>Using an anonymous array type for an object declaration is valid.
>
>	type R is record
>	    X : array (1 .. 10) of Integer;
>	  end record;
>
>Using an anonymous array type for the component of a record is invalid.
>Why?  What is the rational for disallowing anonymous array types
>for record components?

The possibility to declare anonymous array types inside a
record types was only removed in a very late stage of the 
Ada language development, it was still present in the 1980
definition.
The following justification is not mine and I do not say that
it clears the question completely. I quote from a paper 
distributed at the Ada-Europe 1982 Conference (joint with AdaTEC)
held in Brussels (you all know now that 's in Belgium). It is
"Summary of language changes" by Ben Brosgol:
    To avoid the semantic complexities of nested type definitions,
    array type definitions may no longer be used in the declaration
    of record components.  (A named array type must be explicitly
    introduced by the programmer instead.)
-- 
jan kok, cwi (afd. nw), amsterdam, nederland
UUCP: {seismo, decvax, philabs, okstate, garfield}!mcvax!zuring!jankok
---------------------------------------------------------------
    "Assembling of Japanese bicycle require peace of mind." (Pirsig)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1986-02-17 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-02-12  1:54 anonymous array types and record components Doug Bryan
1986-02-17 12:50 ` jankok

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