comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Ragged Array Proposal
Date: 1999/09/24
Date: 1999-09-24T00:00:00+00:00	[thread overview]
Message-ID: <7sg24e$4oo$1@nnrp1.deja.com> (raw)
In-Reply-To: 37eaa24b@eeyore.callnetuk.com

In article <37eaa24b@eeyore.callnetuk.com>,
  "Nick Roberts" <nickroberts@callnetuk.com> wrote:

> People: String_Array(1..3)(String(1..3),String(1..4),String(1..5));
>

I'm not sure I like this example. Right now in Ada you would have to use
explicit subtypes in any such declaration. But above you are using
anonymous subtypes (eg: "String(1..3)"). I know creating a bunch
of onetime subtypes might seem to be a pain, but it would restore
consistency with the rest of the language.

> (Note the nice, simple syntax.) Either way, People is now permanently
> constrained, both in terms of its indexes and its profile. The
assignment:
>
> People(3) := "Jane";
> People(2) := "Emily";
>
> would raise Constraint_Error. Nothing can change either the index

OK. That's not so bad then. It would seem quite possible to create stack
space for such variables. The only bad issue I still see is that its
probably going to need a dope vector from hell to keep track of all the
contraints of all its elements. But this isn't any different than the
current situation with my array of string pointers.

I'm starting to like this proposal.

I think the syntax does need still some work. For instance, can variant
records be components too? What would one of those declarations look
like? How about classwide tagged types?

Also, if we do this, wouldn't the constrained subtype restriction on
record fields start to look a bit restrictive?

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-09-24  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <37e7c08e@eeyore.callnetuk.com>
1999-09-22  0:00 ` Ragged Array Proposal Ted Dennison
1999-09-22  0:00   ` Ray Blaak
1999-09-23  0:00     ` Ted Dennison
1999-09-23  0:00     ` Tucker Taft
1999-09-23  0:00       ` Nick Roberts
1999-09-23  0:00         ` Hyman Rosen
1999-09-24  0:00           ` Nick Roberts
1999-09-24  0:00             ` Hyman Rosen
1999-09-25  0:00               ` Robert Dewar
1999-09-27  0:00                 ` Hyman Rosen
1999-09-27  0:00                   ` Brian Rogoff
1999-09-28  0:00                   ` Robert Dewar
1999-09-24  0:00         ` Ted Dennison [this message]
1999-09-24  0:00           ` Nick Roberts
1999-09-24  0:00         ` Robert Dewar
1999-09-24  0:00           ` Wes Groleau
1999-09-25  0:00             ` Robert Dewar
1999-09-25  0:00             ` Robert Dewar
1999-09-24  0:00       ` Robert Dewar
1999-09-24  0:00     ` Robert Dewar
1999-09-23  0:00 ` Robert I. Eachus
1999-09-24  0:00   ` Nick Roberts
1999-09-25  0:00     ` Robert Dewar
1999-09-25  0:00     ` Robert Dewar
1999-09-25  0:00     ` Robert Dewar
1999-09-27  0:00     ` Ted Dennison
1999-09-27  0:00       ` Pascal Obry
1999-09-28  0:00         ` Ted Dennison
1999-09-28  0:00           ` Robert Dewar
1999-09-29  0:00             ` Geoff Bull
1999-09-28  0:00       ` Robert Dewar
replies disabled

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