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.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,772ae8afc5db35f2 X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Single Extension; Polymorphic Arrays Date: 1999/03/08 Message-ID: <7c1dn4$t83$1@plug.news.pipex.net>#1/1 X-Deja-AN: 452701990 References: X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom) Newsgroups: comp.lang.ada Date: 1999-03-08T00:00:00+00:00 List-Id: Nevertheless, I think I could give you numerous examples of an array declaration -- particularly constant ones -- for which a separate type declaration would have been just plain silly. I will cite one example here. In the implementation of Ada.Calendar (for my compiler :-) I have an array which holds the number of days expired before the beginning of each month: DbM: constant array (Month_Number) of Year_Days := (0, 31, ...); Surely, it simply wouldn't make sense to explicitly declare a type for this array, would it? Such a type would never need to be used anywhere else; I have to admit, it would be likely to do no harm other than adding a little clutter. I suppose, at the end of the day, it is a subjective argument, but personally I prefer to have the special case of array object declarations. ------------------------------------- Nick Roberts ------------------------------------- Matthew Heaney wrote in message ... [...] |> On the other hand, "singleton" arrays are truly just a short-hand, |> and I would agree that they add some complexity, primarily because |> they are a special case. | |This is really what I was complaining about. I read in one of early Ada |(83) papers (by Brian Wichmann?) that the reason this feature was |included was to appease Fortran programmers switching to Ada. | |Its presence in the language complicates things for neophytes, because |it makes you think that you can do this: | | type RT is | record | O : array (1 .. 5) of Integer; | end record; | |which is of course illegal. But it _looks_ like legal, eh?