comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: null array constant in Ada 83
Date: Tue, 23 Jun 2009 14:11:10 GMT
Date: 2009-06-23T14:11:10+00:00	[thread overview]
Message-ID: <2o50m.84630$d36.46020@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 4a40c4e8$1@news.post.ch

Even though there are many features that are the same, there are 
also many changes from Ada 83 to Ada 95 or Ada 2005 so that you 
should download and use the Ada 83 LRM for maintain Ada 83 programs.


So you might need to use "'First" or "'Last" to define a initial value 

   -- N_Sel_Entry_Value is used set to an inital value 

   N_Sel_Entry_Value : constant T_Sel_List_Entry := T_Sel_List_Entry'First;  

   N_Sel_List : constant T_Sel_List (1 .. 0) := (1 .. 0 => N_Sel_Entry_Value);



Ada 83 RM 3.2.1

    OPTION      : BIT_VECTOR(1 .. 10) := (others => TRUE); 

Then Ada 83 RM 3.6 defines
    type TABLE    is array(1 .. 10) of INTEGER;

then from, Ada 83 RM 4.3.2  Array Aggregates

    TABLE'(5, 8, 4, 1, others => 0)  --  see 3.6 





In <4a40c4e8$1@news.post.ch>, Martin Krischik <krischik@users.sourceforge.net> writes:
>Frank J. Lhota schrieb:
>> Martin Krischik wrote:
>>> Hi,
>>>
>>> maintaining old code is such a great fun. Anybody know what goes where
>>> the 4 dots are (an appropriate N_Sel_List_Entry is declared).
>>>
>>>    subtype T_Sel_Entries is Integer range 0 ..
>>> Selection_Types.Max_Selection_Results;
>>>
>>>    type T_Sel_List is array (T_Sel_Entries range <>) of T_Sel_List_Entry;
>>>
>>>    N_Sel_List : constant T_Sel_List (1 .. 0) := ....;
>>>
>>> Or is it just plain impossible in Ada 83.
>>>
>>> Regards
>>>
>>> Martin
>> 
>> If N_Sel_Entry_Value is a value of type N_Sel_List_Entry, then you could
>> write
>> 
>>    N_Sel_List : constant T_Sel_List (1 .. 0) :=
>>       (1 .. 0 => N_Sel_Entry_Value);
>
>I see - I tried "other =>" - and that did not work at least not with Ada 83.
>
>> The fact that you have to provide a component value that is never used
>> is a well known annoyance.
>
>I know. Even more interesting is creating a constant of a null record
>(tied that in a prototype just recently). I found the syntax in the Ada
>95 RM only to find out that Ada 83 does not know about it. But since it
>was a prototype I did not bother looking into it.
>
>Martin
>
>-- 
>mailto://krischik@users.sourceforge.net
>Ada programming at: http://ada.krischik.com




  parent reply	other threads:[~2009-06-23 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23  8:57 null array constant in Ada 83 Martin Krischik
2009-06-23  9:26 ` Peter Hermann
2009-06-23  9:30 ` Frank J. Lhota
2009-06-23 12:04   ` Martin Krischik
2009-06-23 13:05     ` Jean-Pierre Rosen
2009-06-23 14:11     ` anon [this message]
2009-06-23  9:31 ` AdaMagica
replies disabled

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