[Melbourne-pm] Memoize subroutine annotations

Toby Corkindale toby.corkindale at strategicdata.com.au
Wed Jun 2 21:02:17 PDT 2010


On 03/06/10 13:56, Daniel Pittman wrote:
> 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

Unsure, but suspect you shouldn't be Memoizing Catalyst Actions as they 
have side-effects anyway?


More information about the Melbourne-pm mailing list