comp.lang.ada
 help / color / mirror / Atom feed
From: Ian Clifton <ian@melvin.dp.ox.ac.uk>
Subject: Re: Ada question (defining types)
Date: 2000/08/17
Date: 2000-08-17T14:13:36+00:00	[thread overview]
Message-ID: <4qn1icynzk.fsf@melvin.dp.ox.ac.uk> (raw)
In-Reply-To: pdxem3o80ma.fsf@vesuri.Helsinki.FI

>>>>> "Aaro" == Aaro Koskinen <aaro@iki.fi> writes:

    reinert@ola.npolar.no (Reinert Korsnes) writes:
    >> Is it possible to make the following more compact and relyable
    >> (less typo/error prone):
    >> Longs : constant array ( Long_I ) of Integer := ( 0, 5, 10, 15,
    >> 20, 25, 30, 35, 40, 45, 50,
    >> 300,305,310,315,320,325,330,335,340,345,350,355);

    Aaro> Implement it using a function instead of an array.

Yes, I think this is the most natural way of doing it in Ada. 

If for some reason you really want the constant array, there's no
`implied do' construct in Ada's `array aggregate' array constructor as
there is in Fortran95 (I suspect this might be the feature Reinert is
missing). You could however initialize your constant array with an
array-valued generator function (which would in effect be an Ada-style
wrapper for such an `implied do').

-- 
Ian Clifton                   Phone: +44 1865 275631
Dyson Perrins Laboratory      Fax:   +44 1865 275674
Oxford University  OX1 3QY UK ian.clifton@linacre.ox.ac.uk




  reply	other threads:[~2000-08-17  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-17  0:00 Ada question (defining types) Reinert Korsnes
2000-08-17  0:00 ` Aaro Koskinen
2000-08-17  0:00   ` Ian Clifton [this message]
2000-08-18  0:00 ` Dr. Joachim Schr�er
replies disabled

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