On Thu, Mar 29, 2001 at 10:36:48AM -0800, Hong Zhang wrote:
> I have to say that I agree to disagree. Since it has been so controversal,
> I just don't think this optimization is a good one.
Hmm, we aren't talking sort() specificly anymore. Look at the subject line.
<G>
> The function in Ada can not have any side effect, i.e. no change to globals.
> The procedure can have side effect. It gives compilers some more chances
> for optimizations. For example (pseudo code),
> function comp(int n, int m) : int;
> the compiler can safely remember the result of comparison for the same
> arguments.
Ahh, bingo. That's what a number of people (inculding me) are suggesting --
a :functional / :pure / :stateless / :somthingelseIdontrecall attribute
attachable to a sub.
-=- James Mastros
--
The most beautiful thing we can experience is the mysterious. It is the
source of all true art and science. He to whom this emotion is a stranger,
who can no longer pause to wonder and stand wrapt in awe, is as good as dead.
-=- Albert Einstein
AIM: theorbtwo homepage: http://www.rtweb.net/theorb/