comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Private discrete type as index
Date: Fri, 17 Jan 2003 17:28:00 +0100
Date: 2003-01-17T17:28:00+01:00	[thread overview]
Message-ID: <b09auf$n7ro0$2@ID-77047.news.dfncis.de> (raw)
In-Reply-To: PXPV9.32480$F63.631828@news.xtra.co.nz

AG wrote:

> 
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:b0435c$la5bg$1@ID-77047.news.dfncis.de...
>> tmoran@acm.org wrote:
>>
>> >>   type x is limited private;
>> >>   type test is array(x) of boolean;
>> >   The "array" abstraction has certain characteristics, among them
>> > sequential indexing.
>>
>> Why so? Array is just a mapping index->element, so if no index ranges
>> required then the array index need not to be ordered (have "<" and "="),
>> only "=" is required.
> 
> I suppose the answer will be that index ranges *are* required
> by the array semantics (in Ada, at least).

But we are no more talking about Ada. (:-)) In Ada it is anyway impossible. 

And as for array semantics I would like to have two different kinds of 
arrays: ones with an ordered index (like in Ada) and others with an 
unordered index. Unordered arrays could to be used when index order may 
vary from platform to platform (so programmer cannot rely on ranges) and 
maybe for sparse arrays with very large indices and list representation.

> But, as you pointed out:
> 
>> Anyway a limited type is allowed to have both.
> 
> So, it should be able to meet the range requirements too.
> At least if the provider of the type also provides the minimum
> set of operations.

Such as ranges and the operations "..", 'range etc. This is even more 
distant from present Ada.

-- 
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de



      parent reply	other threads:[~2003-01-17 16:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-11 21:42 Private discrete type as index AG
2003-01-11  2:34 ` James S. Rogers
2003-01-12  0:09   ` AG
2003-01-11  7:16     ` James S. Rogers
2003-01-12  5:47       ` AG
2003-01-11 12:22         ` Dmitry A. Kazakov
2003-01-11 14:36         ` Charles H. Sampson
2003-01-12 19:23 ` Keith Thompson
2003-01-12 19:48   ` tmoran
2003-01-15 16:45     ` Dmitry A. Kazakov
2003-01-18  6:24       ` AG
2003-01-17 14:14         ` tmoran
2003-01-19  1:38           ` AG
2003-01-18  8:36             ` tmoran
2003-01-19  6:06               ` AG
2003-01-17 16:28         ` Dmitry A. Kazakov [this message]
replies disabled

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