From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48fa8e3cfaec41af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-23 08:02:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: worth the hassle? Date: 23 Jul 2002 11:00:40 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1027436969 27361 128.183.220.71 (23 Jul 2002 15:09:29 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 23 Jul 2002 15:09:29 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:27333 Date: 2002-07-23T15:09:29+00:00 List-Id: "chris.danx" 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