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.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,effb80d4bb7716dd X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Pointer Arithmetic (was: Wanted: Ada STL....) Date: 1999/02/03 Message-ID: <798u7q$b2k$1@plug.news.pipex.net>#1/1 X-Deja-AN: 440097173 References: <790f4q$3l@bgtnsc01.worldnet.att.net> <797na3$obg$1@nnrp1.dejanews.com> <36B78CDD.1372@lanl.gov> <798d2s$cce$1@nnrp1.dejanews.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom) Newsgroups: comp.lang.ada Date: 1999-02-03T00:00:00+00:00 List-Id: adam@irvine.com wrote in message <798d2s$cce$1@nnrp1.dejanews.com>... [...] |It's certainly conceivable (if you have a package that declares |an iterator, for example) that the index manipulation might not even be |handled within the same subprogram call. You might have to provide a |routine that steps to the next element of the array, then saves the index |in a global variable or an object's "work area" before the subprogram exits, |and then use the saved index the next time the subprogram is called. [...] In a case like this - where speed really mattered (and it does sometimes) - the programmer would make the inner subroutine 'inline' - so that it was effectively expanded into its constituent statements in place of every call. The compiler would then be able to optimise the code from indexes into pointers (and all the other ways) with no problem. Some compilers can perform inter-procedural optimisations anyway, including the keeping of an intermediate value in a register between calls. ------------------------------------------- Nick Roberts -------------------------------------------