Re:Quote-Unquote "Macros"
by homedirectory on Wednesday August 14, 2024 @01:47AM
(#41242962)
You can achieve memoization of an expression inside a function without any global state and macros:
[ Parent
| on HN ]
TFA wants to memoize separately per call site.
Re:Quote-Unquote "Macros"
by homedirectory on Wednesday August 14, 2024 @09:30AM
(#41245847)
From the article:
> I want it to be the case that this function only actually calls do-something-very-expensive once per unique value of x, even across separate invocations of dumb-example.
My code memoizes results of function FIB _inside_ the lambda assigned to EXAMPLE, even across separate invocations of EXAMPLE.