How to implement immutable ring buffer?

2015-05-27 Thread drug via Digitalmars-d-learn
Could somebody share his thoughts on the subject? Would it be efficient? Is it possible to avoid memory copying to provide immutability? To avoid cache missing ring buffer should be like array, not list, so it's possible that the whole buffer should be moved. Is it neccessary to be real

Re: How to implement immutable ring buffer?

2015-05-27 Thread drug via Digitalmars-d-learn
On 27.05.2015 11:04, thedeemon wrote: This whole idea sounds self-contradictory. Ring buffer is a mutable-array-based implementation of something, for example of a queue. You can ask about immutable implementations of a queue, but that would be another question, not involving a ring buffer.

Re: How to implement immutable ring buffer?

2015-05-27 Thread Daniel Kozák via Digitalmars-d-learn
On Wed, 27 May 2015 09:20:52 + drug via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Could somebody share his thoughts on the subject? Would it be efficient? Is it possible to avoid memory copying to provide immutability? To avoid cache missing ring buffer should be like

Re: How to implement immutable ring buffer?

2015-05-27 Thread thedeemon via Digitalmars-d-learn
This whole idea sounds self-contradictory. Ring buffer is a mutable-array-based implementation of something, for example of a queue. You can ask about immutable implementations of a queue, but that would be another question, not involving a ring buffer. What do you want to do with this

Re: How to implement immutable ring buffer?

2015-05-27 Thread drug via Digitalmars-d-learn
On 27.05.2015 11:10, Daniel Kozák via Digitalmars-d-learn wrote: On Wed, 27 May 2015 09:20:52 + drug via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Could somebody share his thoughts on the subject? Would it be efficient? Is it possible to avoid memory copying to provide