Re: Array, AA Implementations

2009-10-22 Thread Don
Andrei Alexandrescu wrote: Bill Baxter wrote: On Wed, Oct 21, 2009 at 6:35 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: 3. Remove some element from the container and give it to me E removeAny(); 4. Add an element to the container is possible bool add(E); I think any

Re: Array, AA Implementations

2009-10-22 Thread Pelle MÃ¥nsson
Don wrote: Andrei Alexandrescu wrote: Bill Baxter wrote: On Wed, Oct 21, 2009 at 6:35 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: 3. Remove some element from the container and give it to me E removeAny(); 4. Add an element to the container is possible bool add(E); I

Re: Array, AA Implementations

2009-10-22 Thread Steven Schveighoffer
On Thu, 22 Oct 2009 09:07:47 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Don wrote: Andrei Alexandrescu wrote: Bill Baxter wrote: On Wed, Oct 21, 2009 at 6:35 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: 3. Remove some element from the container and

Re: Array, AA Implementations

2009-10-21 Thread Yigal Chripun
On 19/10/2009 23:42, Andrei Alexandrescu wrote: Yigal Chripun wrote: here's an example of a well designed, consistent API: http://www.gobosoft.com/eiffel/gobo/structure/index.html This is a solid framework, unlike Java's containers which are a joke. I disagree with some of Gobo's abstractions

Re: Array, AA Implementations

2009-10-21 Thread Denis Koroskin
On Thu, 22 Oct 2009 01:35:49 +0400, Yigal Chripun yigal...@gmail.com wrote: On 19/10/2009 23:42, Andrei Alexandrescu wrote: Yigal Chripun wrote: here's an example of a well designed, consistent API: http://www.gobosoft.com/eiffel/gobo/structure/index.html This is a solid framework, unlike

Re: Array, AA Implementations

2009-10-21 Thread Andrei Alexandrescu
Yigal Chripun wrote: On 19/10/2009 23:42, Andrei Alexandrescu wrote: Yigal Chripun wrote: here's an example of a well designed, consistent API: http://www.gobosoft.com/eiffel/gobo/structure/index.html This is a solid framework, unlike Java's containers which are a joke. I disagree with some

Re: Array, AA Implementations

2009-10-21 Thread Rainer Deyke
Andrei Alexandrescu wrote: IMHO any container must offer at the very least (I'll use stylized signatures): 2. Iterate using at least a one-pass range OnePassRange!E opSlice(); Requiring this to be O(1) seems silly, since the actual iteration will never be O(1) and can't even be guaranteed

Re: Array, AA Implementations

2009-10-21 Thread Bill Baxter
On Wed, Oct 21, 2009 at 6:35 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: 3. Remove some element from the container and give it to me E removeAny(); 4. Add an element to the container is possible bool add(E); I think any container must support these primitives in O(1),

Re: Array, AA Implementations

2009-10-21 Thread Andrei Alexandrescu
Rainer Deyke wrote: Andrei Alexandrescu wrote: IMHO any container must offer at the very least (I'll use stylized signatures): 2. Iterate using at least a one-pass range OnePassRange!E opSlice(); Requiring this to be O(1) seems silly, since the actual iteration will never be O(1) and can't

Re: Array, AA Implementations

2009-10-21 Thread Andrei Alexandrescu
Bill Baxter wrote: On Wed, Oct 21, 2009 at 6:35 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: 3. Remove some element from the container and give it to me E removeAny(); 4. Add an element to the container is possible bool add(E); I think any container must support these

Array, AA Implementations

2009-10-19 Thread dsimcha
Since there has been a lot of discussion here lately about how AAs and ArrayBuilders should be implemented, we should set up a website where people can contribute different candidate implementations and comment on them. It's much easier to know whether something is a good idea when you have a

Re: Array, AA Implementations

2009-10-19 Thread Andrei Alexandrescu
dsimcha wrote: Since there has been a lot of discussion here lately about how AAs and ArrayBuilders should be implemented, we should set up a website where people can contribute different candidate implementations and comment on them. It's much easier to know whether something is a good idea

Re: Array, AA Implementations

2009-10-19 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article dsimcha wrote: Since there has been a lot of discussion here lately about how AAs and ArrayBuilders should be implemented, we should set up a website where people can contribute different candidate implementations

Re: Array, AA Implementations

2009-10-19 Thread Jerry Quinn
dsimcha Wrote: If anyone can think of any more, please let me know. Also, just thought of this now: I wonder if it would make sense to use some polymorphism tricks (AA operations are slow enough that an extra pointer dereference or virtual function call isn't going to make or break

Re: Array, AA Implementations

2009-10-19 Thread dsimcha
== Quote from Jerry Quinn (jlqu...@optonline.net)'s article dsimcha Wrote: If anyone can think of any more, please let me know. Also, just thought of this now: I wonder if it would make sense to use some polymorphism tricks (AA operations are slow enough that an extra pointer

Re: Array, AA Implementations

2009-10-19 Thread dsimcha
== Quote from Piotrek (star...@tlen.pl)'s article dsimcha pisze: 3. An implementation I call StaticAA, which does not allow the addition or removal of keys after it is constructed, but in exchange has almost zero space overhead and is very GC-efficient. It works by maintaining sorted

Re: Array, AA Implementations

2009-10-19 Thread Yigal Chripun
On 19/10/2009 21:20, dsimcha wrote: == Quote from Jerry Quinn (jlqu...@optonline.net)'s article dsimcha Wrote: If anyone can think of any more, please let me know. Also, just thought of this now: I wonder if it would make sense to use some polymorphism tricks (AA operations are slow enough

Re: Array, AA Implementations

2009-10-19 Thread dsimcha
== Quote from Yigal Chripun (yigal...@gmail.com)'s article On 19/10/2009 21:20, dsimcha wrote: == Quote from Jerry Quinn (jlqu...@optonline.net)'s article dsimcha Wrote: If anyone can think of any more, please let me know. Also, just thought of this now: I wonder if it would make

Re: Array, AA Implementations

2009-10-19 Thread Andrei Alexandrescu
Yigal Chripun wrote: here's an example of a well designed, consistent API: http://www.gobosoft.com/eiffel/gobo/structure/index.html This is a solid framework, unlike Java's containers which are a joke. I disagree with some of Gobo's abstractions (e.g. I believe all containers must be