Le 3 nov. 2014 22:13, "Hilaire" <hila...@drgeo.eu> a écrit :
>
> What's wrong with?
>
> myData
>  ^ data ifNil: [data := self computeMe]

That I do have a lot of places like this and do not want these data
littering the code.

Aspects would solve this but we do not have that.

Also I need the mechanism to be removable.

So, I read something about MethodWrapper, ghost, slots... Can't one use any
of these things to do this memoization cleanly?

Phil

>
>
>
> Le 03/11/2014 16:10, p...@highoctane.be a écrit :
> > How can I do memoization in Pharo?
> >
> > I mean, a generic mechanism that will help me wrap the caching around
> > the method invocations / messages.
> >
> > I have expensive calls that do not have to refresh their results as
> > often as they are called.
> >
> > TIA
> > Phil
>
>
> --
> Dr. Geo - http://drgeo.eu
> iStoa - http://istoa.drgeo.eu
>
>
>

Reply via email to