[Melbourne-pm] Memoize subroutine annotations

Daniel Pittman daniel at rimspace.net
Wed Jun 2 20:56:12 PDT 2010


Toby Corkindale <toby.corkindale at strategicdata.com.au> writes:

> Memoize is useful, but having to specify routines seems a bit backwards.
>
>   sub my_subroutine { .. do stuff .. }
>   memoize('my_subroutine');

Oh, CLOS, where are you when I want to write a memozing method combination for
Moose, eh?

> Luckily, you can enable a method annotation instead, with Attribute::Memoize:
>
>   sub my_subroutine :Memoize { .. do stuff .. }

Does that conflict with other uses of attributes, such as Catalyst?
        Daniel

-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons


More information about the Melbourne-pm mailing list