On Tue, Sep 19, 2000 at 06:57:07AM -0000, Perl6 RFC Librarian wrote:

> =head1 OUTSTANDING ISSUES
> 
> A few people mentioned that using memoize() as a function has some 
> action-at-a-distance qualities, although it is useful for caching 
> builtin functions such as cos() and sin().

But those could be done using global overrides, something like (I forget
the exact syntax)

  sub GLOBAL::cos :memoize { CORE::cos($_[0] }

> Bart Lateur mentioned that using a sub attribute would be logical:
> 
>       sub foo :memoize {
>       }
> 
> While this does have merit, it does raise a few issues, such as being
> able to turn on various Memoize extensions (such as expiry, tied
> caches, etc.).  On the other hand, this syntax does have merit for
> using the default set of memoize options on a sub, without any
> action-at-a-distance after effects.

There could still be a Memoize which allowed you to get the memoize
attributes of a sub and manipulate them, but as ytou say that is a language
issue.

> Add memoize into the perl6 source tarball, as a pragmatic module.

It should not be a pragmatic module as it has no affect on the compiler
by itself, it provides functions.

Graham.

Reply via email to