tag:blogger.com,1999:blog-876358347971598886.post6537566922744446375..comments2023-03-25T16:20:46.021+03:00Comments on nothingmuch's perl blog: Cache Assertionsnothingmuchhttp://www.blogger.com/profile/03855760206940108541noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-876358347971598886.post-89605332693406552102009-09-14T23:51:45.732+03:002009-09-14T23:51:45.732+03:00If no caching was in place this would be lexically...If no caching was in place this would be lexically almost the same code, the caching merely adds the call to the cache helper and the curlies around the cached expression.<br /><br />Introducing the extra thunk indirection is a minimal code change from what it would have been without caching.<br /><br />If the caching logic is not a fundamental part of the algorithm then I usually see it as a cross cutting concern that should impact the code as little as possible.nothingmuchhttps://www.blogger.com/profile/03975438115490089158noreply@blogger.comtag:blogger.com,1999:blog-876358347971598886.post-73554623153674909092009-09-13T18:32:35.770+03:002009-09-13T18:32:35.770+03:00Why do you use a thunk instead of delegating to a ...Why do you use a thunk instead of delegating to a helper class, say, or hard coding the computation into the caching class (perhaps derived from a more generic class)?DFHhttps://www.blogger.com/profile/16970468114812494546noreply@blogger.com