comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@acm.nospam.org>
Subject: Re: copying data between memory locations
Date: Tue, 04 Sep 2007 20:12:25 GMT
Date: 2007-09-04T20:12:25+00:00	[thread overview]
Message-ID: <J_iDi.68174$Xa3.1749@attbi_s22> (raw)
In-Reply-To: <1188929814.160464.273080@g4g2000hsf.googlegroups.com>

jef.mangelschots@gmail.com wrote:
> 
> It is an Ada83 project with a very short deadline. This section of
> code is non-vital. Hopefully our last new Ada83 project (Ada83 is
> dictated by the compiler we use. not because we want it). Next
> projects will be Ada95/2005 on a new platform with new compilers.
> The reason why I ask the question is because we typically never do
> this kind of stuff and do it in ways suggested in your replies, hence
> my question. Thanks for the answers though.

If you were using Ada 95, the low-level approach might be the best way 
to meet your deadline. But in Ada 83 this sort of thing is so compiler 
dependent and often unclear and difficult that I would be surprised if I 
weren't done sooner taking the Ada approach than the one you're trying 
to use.

> The fact that Ada95 has a feature that could help us out means that it
> isn't an unreasonable request.

This doesn't follow. Unreasonable things were added in Ada 95. Which 
they are depends on the individual. Ada 07 added some more.

> The difficulty is in maintaining a reference to these buffers, which
> are located and maintained elsewhere, in an array of structures, and
> access them via these references in a generic way rather than directly
> via their implementation-specific interfaces.

References in Ada are best done through access values. The language 
provides a mechanism for accessing things via access values. Your 
compiler probably provides a (non-portable) way to convert your existing 
addresses to access values.

"An array of structures" implies array indices and a common 
implementation. Could you use the index into the array as the reference 
and a common operation that takes the index as a parameter to access 
them? That would seem to be simple and clear.

-- 
Jeff Carter
"What I wouldn't give for a large sock with horse manure in it."
Annie Hall
42



  reply	other threads:[~2007-09-04 20:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-03  8:59 copying data between memory locations jef.mangelschots
2007-09-03 10:38 ` Martin Krischik
2007-09-04 15:57   ` Adam Beneschan
2007-09-04 18:16     ` jef.mangelschots
2007-09-04 20:12       ` Jeffrey R. Carter [this message]
2007-09-03 11:09 ` Niklas Holsti
2007-09-03 16:26 ` Steve
2007-09-03 17:22 ` Jeffrey R. Carter
2007-09-04 11:31 ` Stephen Leake
2007-09-05  4:39 ` anon
replies disabled

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