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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,db88d0444fafe8eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Arrays indexed by fixed point types (Was: Surprise in array concatenation) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1125544603.561847.32140@g47g2000cwa.googlegroups.com> <1125610942.747981.280770@f14g2000cwb.googlegroups.com> Date: Mon, 5 Sep 2005 14:14:58 +0200 Message-ID: <1x7uhgunzbhct.xbqo7v5cc5o7$.dlg@40tude.net> NNTP-Posting-Date: 05 Sep 2005 14:14:58 MEST NNTP-Posting-Host: edec7d8e.newsread2.arcor-online.net X-Trace: DXC=74jE@]12Fg^C3N6I?YBjS[Q5U85hF6f;TjW\KbG]kaMXQ>n?D9BSA]\gY4RHZ3W2oXWRXZ37ga[7Zn919Q4_`VjYB8=X\UUgbkT X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:4439 Date: 2005-09-05T14:14:58+02:00 List-Id: On 05 Sep 2005 11:32:23 +0200, Jacob Sparre Andersen wrote: > Jean-Pierre Rosen skrev: > >>>>The values are integral multiples of small, which can be supplied >>>>by the user. So I'd expect to be able to use fixed point types as >>>>array indices etc. You cant :( Wouldn't fixed point be *much* >>>>more useful if it was discrete? >> >> That's the view of the solution space. The view of the problem space >> is that they are a different approximation of real numbers (floating >> point values being the other one). And you can't index an array with >> real values, whether float or fixed. > > I find that definition of arrays rather limited. > 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. So the array index type should not be float (=uncountable in the problem space), but from some finite set of intervals (=countable in the problem space.) [ However in my view array is just a syntax sugar, something with the operation "()". ] > As it is > now, I have to mess around with mapping my (approximated) real numbers > onto an integer scale and back again. 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de