From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c63aa81a67eceb8f X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Ragged Array Proposal Date: 1999/09/24 Message-ID: <7sg24e$4oo$1@nnrp1.deja.com>#1/1 X-Deja-AN: 528962467 References: <37e7c08e@eeyore.callnetuk.com> <7satei$e2q$1@nnrp1.deja.com> <37EA4E91.1D4D1FC@averstar.com> <37eaa24b@eeyore.callnetuk.com> X-Http-Proxy: 1.0 x39.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Sep 24 14:33:50 1999 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 1999-09-24T00:00:00+00:00 List-Id: In article <37eaa24b@eeyore.callnetuk.com>, "Nick Roberts" 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.