ITA. I was planning on doing what clojure.contrib.sql does with a global var and with-connection block for dynamic binding. Unless people don't like that approach...
On Sep 2, 12:56 pm, Mike Meyer <mwm-keyword-googlegroups. 620...@mired.org> wrote: > On Wed, 1 Sep 2010 15:14:45 -0700 (PDT) > > > > > > Alyssa Kwan <alyssa.c.k...@gmail.com> wrote: > > I'll go one step further and say that we shouldn't have to call > > "persist namespace". It should be automatic such that a change to the > > state of an identity is transactionally written. > > > Let's start with refs. We can tackle the other identities later. > > > The API is simple. Call (refp) instead of (ref) when creating a > > persisted ref. Passed into the call are a persistence address (file > > path, DB connection string, etc.) and a name that has to be unique to > > that persistence address. Not all refs end up being referred to by a > > top-level symbol in a package, and multi-process systems are hard... > > Ensuring uniqueness of name is up to the programmer. Upon creation, > > Clojure checks to see if the refp exists in the store; if so it > > instantiates in memory with that state, else it uses the default in > > the call. > > First, I like the idea. But I think it's a bit clunky. Putting the > address information directly in the refp means you'll probably need it > in multiple places, as the most common usage is probably to store more > than one data item in each storage. This strikes me as a bad idea, > violating DRY. > > How about introducing a second part to the api? (store) creates a > wrapper for the persistent address, and refp then takes one of those > wrappers and the name? > > <mike > -- > Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html > Independent Network/Unix/Perforce consultant, email for more information. > > O< ascii ribbon campaign - stop html mail -www.asciiribbon.org -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en