comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Technical Question.
Date: Mon, 16 Jun 2014 00:31:48 +0300
Date: 2014-06-16T00:31:48+03:00	[thread overview]
Message-ID: <c06hm5Fd4i4U1@mid.individual.net> (raw)
In-Reply-To: <c889aca7-eb66-47b8-bcdd-ccc0dfc374b3@googlegroups.com>

On 14-06-09 15:15 , Austin Obyrne wrote:

> This is an array below that loads the 'I' coefficients of a vector
> (the J and K coefficients are elsewhere also in other arrays not
> shown here).

  [snip]

> The procedure below scrambles the elements of the array called 'E' by
> positional reshuffling them from their original assigned position and
> repositioning them by controlled means in another array called 'EE'.

   [snip]

> Question.
> 
> Is this ploy of scrambling key material by this means legit in Ada -
> i.e. is it sanctioned by the Ada reference manual ?

The ARM does not say anything about the legitimacy of a particular
algorithm.

If your Ada algorithm

- is written in legal Ada syntax (which it probably is, if an Ada
compiler compiles it), and

- never uses a variable which has not been first given a value, and

- never indexes an array with a value outside the bounds of the array, and

- never does any thing which the ARM defines as a bounded error or
erroneous execution,

then your Ada program works as its source-code says it should, and is
"legit".

I haven't analysed your algorithm to see if it might do any of those bad
things. Some of the bad things will be caught by run-time checks and
exceptions, but some may not; in particular the use of uninitialized
variables is such a risk. Consider using pragma Normalize_Scalars to
help detect such errors.

> i.e. is it acceptable to you guys as *proper Ada orogramming
> practice?.

"Scrambling an array", whatever that means in general, does not seem
counter to Ada practice. The choice of algorithms is not, IMO, a matter
of Ada practice, but of general SW design.

I could take issue with your Ada coding style and choice of variable
names, etc., but I don't think that is what you are asking about.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .

  parent reply	other threads:[~2014-06-15 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 12:15 Technical Question Austin Obyrne
2014-06-09 12:50 ` Austin Obyrne
2014-06-09 17:54   ` Austin Obyrne
2014-06-15 21:31 ` Niklas Holsti [this message]
2014-06-16 12:49   ` Austin Obyrne
replies disabled

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