[CMEMOIZE-9] memo-swap! is misnamed Created: 23/Sep/13 Updated: 01/Mar/18
|Reporter:||Mark Engelberg||Assignee:||Sean Corfield|
In order to be analogous to atoms, the current behavior of memo-swap! should be called memo-reset! since it overwrites the entire memo map. Similarly, there should be a function called memo-swap! that does an atomic swap operation on the memo cache so, for example, you can add a single value to the cache.
|Comment by Sean Corfield [ 01/Mar/18 2:42 AM ]|
Good point! Backward compatibility could be maintained by checking if (map? base) – and perhaps giving a deprecation warning? – but users would have to be very careful that they would be manipulating the cache and core.memoize wraps raw values in IDeref instances so a simple
would not work – it would need to be
which would make this the only place in the API where that is really exposed.