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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,db88d0444fafe8eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!news.glorb.com!news.banetele.no!news.hacking.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Arrays indexed by fixed point types (Was: Surprise in array concatenation) Date: 05 Sep 2005 15:07:38 +0200 Organization: Jacob's private Usenet server Sender: sparre@hugin.crs4.it Message-ID: References: <1125544603.561847.32140@g47g2000cwa.googlegroups.com> <1125610942.747981.280770@f14g2000cwb.googlegroups.com> <1x7uhgunzbhct.xbqo7v5cc5o7$.dlg@40tude.net> NNTP-Posting-Host: hugin.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: jacob-sparre.dk 1125925659 17534 156.148.71.67 (5 Sep 2005 13:07:39 GMT) X-Complaints-To: sparre@jacob-sparre.dk NNTP-Posting-Date: Mon, 5 Sep 2005 13:07:39 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Xref: g2news1.google.com comp.lang.ada:4440 Date: 2005-09-05T15:07:38+02:00 List-Id: Dmitry A. Kazakov wrote: > Jacob Sparre Andersen wrote: > > I have some cases, where my problem is to store data in an array > > indexed by an approximation of real numbers. The most obvious > > (and recurring) example is a histogram of real valued samples. > > Well, but probably those samples aren't real numbers. I suppose they > are rather intervals. Good point. Yes. > I think that instead of blowing up the language with countless types > which might be useful as array indices (actually maps), it would be > much better to provide user-defined index and array types with > primitive operations "()", 'First, 'Range, "in", "not in", aggregate > etc. That would be nice, but wouldn't it be rather difficult to fit into Ada? We would still have the limitation as to which index types could be used together with a for loop, so there would also be a need for some kind of iterator for the user-defined array types. Jacob -- �In Ada you model the problem space, not the solution space.� -- Robert I. Eachus