Bryan@SU-SIERRA.ARPA (Doug Bryan) (02/12/86)
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 -------
jankok@zuring.UUCP (02/17/86)
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)