comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: worth the hassle?
Date: 23 Jul 2002 11:00:40 -0400
Date: 2002-07-23T15:09:29+00:00	[thread overview]
Message-ID: <ulm8232w7.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: nu__8.4842$vN6.246271@newsfep2-win.server.ntli.net

"chris.danx" <spamoff.danx@ntlworld.com> writes:

> Thanks, it's much appreciated!
> 
> Anyone up for another problem? :)
> 
> An iterator points to a list and a position within in that list.  The
> problem is getting a pointer to the list itself, which is an "in" parameter
> (it's not modified) to a function.

This is the problem. There is no portable way to get an access value
to an "in" parameter.

If Ada seems to be in your way when you want to do something, it's for
a good reason!

> What is a good way of getting the pointer to the list? 'access
> doesn't work since list is constant, and I don't want to make the
> parameter an access type since it's not convienant to declare lists
> as aliased all the time.

You can take the approach I did in SAL; don't store a pointer to
the list in the iterators. That makes the iterators "unsafe", but more
efficient.

Or, you can take the approach that Grace.Lists does, and add a layer
of indirection in the List_Type; then you _can_ get an access value to
the list from an "in" parameter.

Unchecked programming is _not_ necessary.

-- 
-- Stephe



  parent reply	other threads:[~2002-07-23 15:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 16:56 worth the hassle? chris.danx
2002-07-22 17:17 ` Wes Groleau
2002-07-22 17:45   ` chris.danx
2002-07-22 19:05     ` Wes Groleau
2002-07-22 17:56 ` chris.danx
2002-07-22 18:06   ` Stephen Leake
2002-07-22 21:06     ` chris.danx
2002-07-23 12:16       ` chris.danx
2002-07-23 12:36       ` chris.danx
2002-07-23 15:00       ` Stephen Leake [this message]
2002-07-23 15:15         ` chris.danx
2002-07-23 15:36           ` chris.danx
2002-07-23 16:19             ` Peter Hermann
2002-07-23 16:41               ` chris.danx
2002-07-23 17:35               ` Stephen Leake
2002-07-22 17:58 ` Stephen Leake
2002-07-22 18:15   ` Frank J. Lhota
2002-07-22 19:56     ` Stephen Leake
2002-07-23  5:56     ` Kevin Cline
2002-07-22 18:44   ` chris.danx
2002-07-23  5:39   ` Kevin Cline
2002-07-23 15:05     ` Stephen Leake
2002-07-23 18:34   ` Perhaps we keep lists elements private and adjust the elements to fit? Chad R. Meiners
2002-07-23 19:23     ` Stephen Leake
replies disabled

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