What's wrong with? myData ^ data ifNil: [data := self computeMe]
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