[CCACHE-29] Is IPersistentCollection definition of cons correct? Created: 18/Nov/12 Updated: 18/Nov/12 |
|
| Status: | Open |
| Project: | core.cache |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Brian Marick | Assignee: | Fogus |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Here's the definition of `cons` for caches: clojure.lang.IPersistentCollection This seems wrong to me. Note first that the arguments to `clojure.core/cons` are in the wrong order. As a result, the result of (for example) conj is incorrect. Consider this: user=> (def starts-with-a (cache/fifo-cache-factory {:a 1} :threshold 3)) #'user/starts-with-a Even if the argument order was correct, the result would still be a sequence rather than the type of the base field. I think you want something more like clojure.lang.IPersistentCollection After all, this particular collection is an IPersistentMap, so its `conj` and `into` behavior should be the same as other objects for which `map?` is true. |