On Wednesday 28 March 2001 11:47, Dan Sugalski wrote:
> 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.
>

But you can't.  A complex sort can currently by simplified, if desired.  To 
invert the behavior (simplification first), you'd still need a way to 
<GWB>recomplexify</GWB> it, for the folks who need a fetch every time.

> Of course, we may not be able to say that, in which case hints of any sort
> are a Good Thing.

Yes.  One way or t'other.

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to