Re: The unshared part of two mostly-shared structures

2009-03-22 Thread e
> > > my programming language enchilada (www.enchiladacode.nl) interesting. I was thinking today about how STM reminds me of version control. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: The unshared part of two mostly-shared structures

2009-03-22 Thread mikel
Thanks for the comments, folks. I may be able to raw some ideas from them. In my specific case, restrictive rules about the types of the objects may be quite workable. For example, I don't think I'd suffer if the state-preserving objects were all required to be hash-maps. I'll think some more abo

Re: The unshared part of two mostly-shared structures

2009-03-22 Thread Stuart Sierra
On Mar 21, 6:01 pm, rapido wrote: > my programming language enchilada (www.enchiladacode.nl) has > hash=pointer equality build in. > i believe it shouldn't be to difficult to introduce some of > enchilada's internals to clojure. Hi Robbert, I imagine that hash-pointer equality would be difficul

Re: The unshared part of two mostly-shared structures

2009-03-21 Thread rapido
i have done some homework on this problem :) (warning: not clojure specific) my claim is that diffing two similar sets (or maps) *can* be made efficient only *if* you can add arbitrary items to sets efficiently (i.e. O(log(n)). remember that immutable sets are usually laid out in a tree structu

Re: The unshared part of two mostly-shared structures

2009-03-21 Thread Chouser
On Sat, Mar 21, 2009 at 12:23 PM, mikel wrote: > > I haven't looked at Clojure at all with this in mind, but I know I'm > soon going to need to implement this updating mechanism. If you know > how to efficiently obtain just the diffrences between two otherwise > shared Maps, I'd be interested to

The unshared part of two mostly-shared structures

2009-03-21 Thread mikel
Clojure efficiently shares structure of composite objects. For example, given a Map with 10,000 entries, you can inexpensively created a new Map with one changed entry, because Clojure reuses the other entries. Is there a convenient and efficient API that can return just the changed entry?