At 11:22 AM 3/28/2001 -0500, John Porter wrote:
>Dan Sugalski wrote:
> > It doesn't really matter if the functions inside the sort function are
> > idempotent--what matters is whether it's OK for us to go and memoize the
> > things (or whatever else we might choose to do)
>
>Exactly, that's what I've been trying to say.
>And that's why I propose the :constant/:function/:pure/:stateless
>attribute, so that perl only has to trust the programmer to say
>which functions can be memoized.
I'm actually considering whether we even need to care what the programmer's
said. If we can just flat-out say "We may optimize your sort function, and
we make no guarantees as to the number of times tied data is fetched or
subs inside the sort sub are called" then life becomes much easier.
Of course, we may not be able to say that, in which case hints of any sort
are a Good Thing.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk