comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Problem to dramatize packed-array/rep-clause difficulties
Date: 1996/03/27
Date: 1996-03-27T00:00:00+00:00	[thread overview]
Message-ID: <dewar.827973914@schonberg> (raw)
In-Reply-To: 4jce00$t75@ra.nrl.navy.mil

Doug Rogers says

"As Robert Dewar pointed out in a private message, I didn't
specify this well enough.  If I must, I will employ this kind
of record on a grand (pardon the pun) scale, with "case"
statements everywhere, etc.  Not elegant, but it definitely
stays within the realm of Ada83."

Well what you are really talking about here is a repeated pattern
of nine byte containing eight fields, so clearly the best approach
if you have such a strange structure (it is one for which I have
never seen anyting in the real world that would correspond, so it
is not surprising that no one else ever asked for this), is to
define an array of these nine byte values, using your case
statement to select the right one of the eight fields. This
is quite easy to program, and incidentally results in the most
efficient possible code. I think you will find that in fact
you get much MORE efficient code this way than you would from
a compiler that supports this kind of jamming (p.s. all Alsys
compilers have always supported this).

And that is really the point here I think. You want to restrict
a compiler's acceptable of rep clauses to things that are close
to the machine and that it can do better than you can. 

Consider by analogy that typical computer languages have a built
in add operator, but do not have a built-in Bessel function operator.





  reply	other threads:[~1996-03-27  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-27  0:00 Problem to dramatize packed-array/rep-clause difficulties tmoran
1996-03-27  0:00 ` Doug Rogers
1996-03-27  0:00   ` Robert Dewar [this message]
1996-03-27  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-03-28  0:00 tmoran
1996-03-28  0:00 ` Robert Dewar
1996-03-28  0:00 tmoran
replies disabled

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