The Melbourne ADUG August meeting is on Monday Night, 19th August
John McDonald will be doing a presentation continuing his exploration of anonymous methods, closures, etc and also looking at the Spring4D Dictionary.
Sorry I will not be in attendance this month, but I am looking forward to viewing the recording. Thank you, John for volunteering to fill in and also getting a presentation together at shortish notice.
When: 6:00pm for a 6:15pm start
Where: At the Melbourne Men’s Shed, and on Zoom.
Zoom link will be up here shortly before the meeting starts.
The example I showed in this presentation was caching, not memoization. Memoization only works with pure functions; functions that always return the same result given the same arguments.
A function that takes a file name and returns a hash of the file contents will return a different result if the contents of the file change. So it is not suitable for memoization.
If you can determine when a cached value is no longer valid, caching can be used in situations where memoization doesn’t work.
The code in my presentation would return a previously calculated value it the timestamp of the file was unchanged. If the timestamp had changed, the cached value was no longer valid and the hash would be recalculated.