comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Need Help On Ada95 Problem
Date: Fri, 10 Feb 2012 07:19:46 -0800 (PST)
Date: 2012-02-10T07:19:46-08:00	[thread overview]
Message-ID: <e2385dd8-f24b-43f6-a41d-36ac90a524dd@x19g2000yqh.googlegroups.com> (raw)
In-Reply-To: jh2a4n$kmn$1@dont-email.me

On Feb 9, 11:32 pm, "Alex" <a...@foo.invalid> wrote:
> Sure you can just use 'Pos! While the positions of the digit characters
> do not correspond directly to their values, they are sequential in the
> ASCII mapping, so all you have to do is subtract the position of the
> Character '0' from each one to calculate its value. Check it out:
>

I know that, I've done it before; I think you misunderstood what I was
trying to say here (or perhaps I was simply using the wrong language):

>
> Shark8 wrote:
> > You can't just index into Character (via 'POS, 'VAL and index-
> > manipulation) because the mapping isn't sequential;
> > or even partly-sequential in the ASCII codes.
>
> > See the (3,4,5) association with (V,A,L) and (6,7,8) with (T,I,N).

Do, let me rephrase:
Letting F(I) be the function taking an integer and returning the
correct character we see that F(3) = V, F(4) = A, and F(5) = L;
this means that the internals of F cannot be a simple offset indexing
into ASCII. Furthermore, as F(6) = T, F(7) = I, and F(8) = N we see
that there is no intuitively obvious subcycle such as one sees when
numbering a chessboard (the multiplication/mod relationship).

Therefore, using a mathematical (arithmetic) function to relate these
numbers and the associated ASCII codes is likely inappropriate.



  reply	other threads:[~2012-02-10 15:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  1:03 Need Help On Ada95 Problem Will
2012-02-09  1:51 ` Robert A Duff
2012-02-09  2:01 ` Shark8
2012-02-10  1:36   ` BrianG
2012-02-10  2:22     ` Shark8
2012-02-10  5:32       ` Alex
2012-02-10 15:19         ` Shark8 [this message]
2012-02-10 15:45           ` Alex
2012-02-10 20:07           ` Robert A Duff
2012-02-12 19:40             ` Will
2012-02-12 19:42               ` Will
2012-02-12 22:26               ` Robert A Duff
2012-02-13  0:41                 ` Will
2012-02-13  0:43                 ` Nasser M. Abbasi
2012-02-10  5:45       ` Alex
2012-02-10 13:29         ` Robert A Duff
2012-02-10 13:50           ` Alex
2012-02-10 14:30             ` Robert A Duff
2012-02-10 15:32               ` Alex
2012-02-10 20:03                 ` Robert A Duff
2012-02-13  3:28       ` BrianG
2012-02-10  8:47   ` Simon Wright
2012-02-09  3:38 ` Alex
     [not found]   ` <90a10801-440b-4a31-88d0-f0f7c17137f1@eb6g2000vbb.googlegroups.com>
2012-02-09 13:35     ` Alex
replies disabled

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