[CLJ-803] IAtom interface Created: 27/May/11 Updated: 10/Jul/14
|Reporter:||Pepijn de Vos||Assignee:||Aaron Bedra|
Atom and the other reference types do not have interfaces and are marked final.
Use cases for interfaces for the reference types include database wrappers. CouchDB behaves exactly like compare-and-set! and is shared, synchronous, independent state, so it makes sense to use the Atom interface to update a CouchDB document.
I talked to Rich about this, and he said "patch welcome for IAtom", complete conversation: http://clojure-log.n01se.net/date/2010-12-29.html#10:04c
|Comment by Stuart Halloway [ 27/May/11 2:33 PM ]|
Please add a patch formatted by "git format-patch" so that attribution is included.
|Comment by Pepijn de Vos [ 04/Jun/11 5:56 AM ]|
I added the formatted patch a few days ago. Does 'no news is good news' apply here?
And, silly question, will it make it into 1.3? I can't figure out how to tell Jira to show me that.
|Comment by Kevin Downey [ 04/Jul/11 9:06 PM ]|
I fail to see the need for an IAtom, if you want something atom like for couchdb the interfaces are already there. Maybe I ICompareAndSwap. Atoms and couchdb are different so making them appear the same is a bad idea.
http://clojure.org/state one of the distinctions between agents and actors raised in the section titled "Message Passing and Actors" is local vs. distributed and the same distinction can be made between couchdb (regardless of compare and swap) and atoms
|Comment by Aaron Bedra [ 04/Jul/11 9:18 PM ]|
This ticket has already been moved into approved backlog. It will be revisited again after the 1.3 release where we will take a closer look at things. For now, this will remain as is.
|Comment by Aaron Craelius [ 10/Jul/14 12:15 PM ]|
Any chance this patch could get implemented in an upcoming Clojure release. There is still continued interest, see this thread: https://groups.google.com/forum/#!topic/clojure-dev/y5QoMqd44Lc
One suggestion I would make is also removing the final marker from clojure.lang.Atom - I can see use cases where one would want to directly subclass Atom (to capture dependencies in reactive computations for instance).