comp.lang.ada
 help / color / mirror / Atom feed
From: "AG" <ang@xtra.co.nz>
Subject: Re: Private discrete type as index
Date: Sat, 18 Jan 2003 17:38:23 -0800
Date: 2003-01-18T17:38:23-08:00	[thread overview]
Message-ID: <wR4W9.33808$F63.664880@news.xtra.co.nz> (raw)
In-Reply-To: adUV9.20206$hl1.1562@sccrnsc04


<tmoran@acm.org> wrote in message news:adUV9.20206$hl1.1562@sccrnsc04...
> >> Why so? Array is just a mapping index->element, so if no index ranges
[ This was not my quote, I was responding to it ...]

> >I suppose the answer will be that index ranges *are* required
> >by the array semantics (in Ada, at least)

>   Perhaps to some people an array is a general map, but to me, and
> to at least the on-line glossaries I checked, it's not that general.
> Your abstraction appears to be a general mapping from elements of
> some set to booleans.

No. What I was originally trying to do was an abstraction as close
to the array as possible (booleans do not matter of course - just
something to put there). At the same time, I wanted to restrict
control of the index to the package implementing it (again, as
much as possible).

So, while I realise I can't (in Ada) provide things like "..",  I can
provide +/-/</> operations of varying flavours on the index. This
would keep most (not all, but most) of the array semantics in place.
Unfortunately, this appears to be impossible.

  Type "x" might be character strings and
> Test(x) True iff a symbol table has seen that string before.  That's
> a perfectly good map, but, IMHO, not something well modeled as an array.
>   My point is that your abstract object doesn't match the idea of
> "array" sufficiently well, and thus probably shouldn't be implemented
> with an array.





  reply	other threads:[~2003-01-19  1:38 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 [this message]
2003-01-18  8:36             ` tmoran
2003-01-19  6:06               ` AG
2003-01-17 16:28         ` Dmitry A. Kazakov
replies disabled

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