[CMEMOIZE-4] Dyadic memo-clear! evicts based on memoized fn args Created: 29/Jun/12 Updated: 29/Jun/12 |
|
| Status: | Open |
| Project: | core.memoize |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Homer Strong | Assignee: | Fogus |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code |
| Description |
|
A straightforward addition for the existing interface to the underlying cache. Useful for cases where the memoization cache need only be evicted for some inputs. Please let me know if this is not the desired channel or format for submissions! |
[CMEMOIZE-1] Cut 0.5.0 release jar Created: 06/Dec/11 Updated: 14/Dec/11 Resolved: 14/Dec/11 |
|
| Status: | Resolved |
| Project: | core.memoize |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Fogus | Assignee: | Fogus |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The core.memoize functionality is inline with Unk. A release should be cut and pushed to Maven central. |
| Comments |
| Comment by Fogus [ 13/Dec/11 7:45 AM ] |
|
v0.5.0 jar deployed to Maven central – awaiting its availability. Release notes outstanding. |
| Comment by Fogus [ 14/Dec/11 7:31 AM ] |
|
Public announcement: http://groups.google.com/group/clojure/browse_thread/thread/340fdd5d64d4a642 Blog post: http://blog.fogus.me/2011/12/14/announcing-core-memoize-v0-5-1/ MVN Central: http://search.maven.org/#browse%7C-296669917 |
[CMEMOIZE-3] snapshot assumes too much about a CacheProtocol implementation Created: 13/Dec/11 Updated: 14/Dec/11 Resolved: 14/Dec/11 |
|
| Status: | Resolved |
| Project: | core.memoize |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Paul Stadig | Assignee: | Unassigned |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Patch: | Code and Test |
| Approval: | Accepted |
| Description |
|
I believe this line https://github.com/clojure/core.memoize/blob/9bdf608af8bbf4a753fc19758446dd821cb45979/src/main/clojure/clojure/core/memoize.clj#L72 assumes too much about implementations of CacheProtocol, namely that they have a field named 'cache'. The first call to .cache makes sense, since PluggableMemoization has a 'cache' field, but the second call to .cache assumes that any implementation of CacheProtocol that PluggableMemoization wraps will have a 'cache' field. I ran into this issue when I desired to have a cache that ignores nils, so I attempted to wrap the TTLCache with an implementation of CacheProtocol that would not cache nil values. Calls to snapshot failed since it was trying to access a 'cache' field on my NoNilCache. I suspect that the outer call to .cache could be replaced with a call to seq, since defcache adds an implementation of seq to each cache implementation which should pull out the keys/values from the cache. I'd be glad to work up a patch given that I'm not off base in my assumptions. |
| Comments |
| Comment by Fogus [ 13/Dec/11 3:08 PM ] |
|
@Paul The better assumption is that the underlying caches are associative. Thanks for reporting and a patch would be wonderful. |
| Comment by Paul Stadig [ 13/Dec/11 4:16 PM ] |
|
Added test and removed one layer of calls to .cache. I tested this against my code base, and it fixes the issue I was seeing. |
| Comment by Paul Stadig [ 13/Dec/11 4:28 PM ] |
|
Updated patch. The tests worked before by throwing an exception on failure, but I updated it by adding an is assertion. |
[CMEMOIZE-2] Deprecate Unk Created: 13/Dec/11 Updated: 13/Dec/11 |
|
| Status: | Open |
| Project: | core.memoize |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Fogus | Assignee: | Fogus |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | documentation, unk | ||
| Description |
|
core.memoize was originally Unk , but its inclusion into contrib means the latter is redundant. The Unk repo should indicate the move and change to a place for docs and examples. Likewise, a formal announcement should be made. |