Re: [pypy-dev] Optimizing Append Only structures

2011-11-29 Thread Armin Rigo
Hi, On Tue, Nov 29, 2011 at 21:28, Romain Guillebert wrote: > Probably because he (as a clojure developer) likes immutability of data > structures. No, it's really needed for the way it is written: by creating a new dict, the old purefunction results no longer apply. But we are (indeed) using a

Re: [pypy-dev] Optimizing Append Only structures

2011-11-29 Thread Romain Guillebert
Probably because he (as a clojure developer) likes immutability of data structures. On Tue, Nov 29, 2011 at 9:15 PM, Maciej Fijalkowski wrote: > On Tue, Nov 29, 2011 at 10:12 PM, Alex Gaynor > wrote: > > > > > > On Tue, Nov 29, 2011 at 3:04 PM, Timothy Baldridge > > > wrote: > >> > >> I have a

Re: [pypy-dev] Optimizing Append Only structures

2011-11-29 Thread Maciej Fijalkowski
On Tue, Nov 29, 2011 at 10:12 PM, Alex Gaynor wrote: > > > On Tue, Nov 29, 2011 at 3:04 PM, Timothy Baldridge > wrote: >> >> I have a dictionary (in RPython) that looks something like this: >> >> >> class MyDict(Obj): >>    def add(self, k, v): >>         newdict = self.dict.copy() >>         new

Re: [pypy-dev] Optimizing Append Only structures

2011-11-29 Thread Alex Gaynor
On Tue, Nov 29, 2011 at 3:04 PM, Timothy Baldridge wrote: > I have a dictionary (in RPython) that looks something like this: > > > class MyDict(Obj): >def add(self, k, v): > newdict = self.dict.copy() > newdict[k] = v > self.dict = newdict >def get(self, k): >

[pypy-dev] Optimizing Append Only structures

2011-11-29 Thread Timothy Baldridge
I have a dictionary (in RPython) that looks something like this: class MyDict(Obj): def add(self, k, v): newdict = self.dict.copy() newdict[k] = v self.dict = newdict def get(self, k): d = self.dict return MyDict._static_get(d, k) @staticmetho