comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: strings and multidimensional arrays
Date: Sun, 12 Oct 2003 19:34:33 GMT
Date: 2003-10-12T19:34:33+00:00	[thread overview]
Message-ID: <d1iib.8562$dn6.4038@newsread4.news.pas.earthlink.net> (raw)
In-Reply-To: <3F89621F.7070406@comcast.net>

Robert I. Eachus wrote:

> type Contents_Type is (None, Integer_Data, Some_String, 
> Integer_and_String, Subprogram_Access, ...);
> 
> type Contents(CT: Contents_Type := None) is record
>   case CT is
>     when None => null;
>     when Integer_Data => I: Integer;
>     when Some_String => U: Ada.Strings.Unbounded.Unbounded_String;
>     when Integer_and_String =>
>       The_Integer: Integer;
>       The_String: Ada.Strings.Unbounded.Unbounded_String;
>     when Subprogram_Access => FP: Function_Pointer;
>     when ...
>   end case;
> end record;
> 
> type Element is record
>    C: Contents := (CT => None);
> end record;
> 
> type My_Array is array(Natural range <>; Natural range <>) of Element;

This is along the lines of what I was going to suggest. I don't 
understand, though, why you wrapped the Contents record in the Element 
record. I would simply say

type Thing is array (Positive range <>, Positive range <>) of CT;

Since you're a language lawyer and I'm not, I guess I'm missing 
something here, and wonder what it is.

-- 
Jeff Carter
"I've got to stay here, but there's no reason
why you folks shouldn't go out into the lobby
until this thing blows over."
Horse Feathers
50




  reply	other threads:[~2003-10-12 19:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-12  4:05 strings and multidimensional arrays Andrew
2003-10-12  5:24 ` Andrew
2003-10-12  6:27   ` tmoran
2003-10-12 14:16   ` Robert I. Eachus
2003-10-12 19:34     ` Jeffrey Carter [this message]
2003-10-13  0:02       ` Robert I. Eachus
2003-10-13  3:14         ` Jeffrey Carter
2003-10-13 17:05           ` Robert I. Eachus
2003-10-13 18:49             ` Martin Dowie
2003-10-13 21:47               ` Mark Lorenzen
2003-10-14  1:10             ` Jeffrey Carter
2003-10-14 15:29               ` Robert I. Eachus
2003-10-12 21:01     ` Andrew
2003-10-13 13:59 ` Rodrigo Garcia
  -- strict thread matches above, loose matches on Subject: below --
2003-10-14  6:24 christoph.grein
replies disabled

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