comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: null array constant in Ada 83
Date: Tue, 23 Jun 2009 14:04:39 +0200
Date: 2009-06-23T14:04:39+02:00	[thread overview]
Message-ID: <4a40c4e8$1@news.post.ch> (raw)
In-Reply-To: <h1q7bj$sfh$1@news.albasani.net>

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



  reply	other threads:[~2009-06-23 12:04 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 [this message]
2009-06-23 13:05     ` Jean-Pierre Rosen
2009-06-23 14:11     ` anon
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