www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D2 std.container ? container update events..

reply BLS <windevguy hotmail.de> writes:
Now How is it..
We had a long and interesting discussion about ranges vs java/C whatever 
style(d) iterators.  ... to bring in an idea.. what about
implementing update events for collections. IMHO this is a very 
reasonable feature.

(I am not talking about non-modifying events likewise cursor/snapshot 
creation-events or cursor moving-events.. Interesting though )

sample: database update events will force to pull data when needed and 
not just in case.
Indeed this is a high end feature, so what about
create auto structures ..say.. backup structures on events..

Our container(T) implementation can be based on a linked list 
implementing a forward range and will feed our UnDo container(T) 
(based i.e. on remove events)

It would be very interesting to see how all these necessary D2 
components : ranges, std.algo, collection/container, aliases and 
delegates will come together.

...I think our node like stuff (the core data structure) should be 
implemented as structure, our container as class-interface pair where 
the interface describes at least the range. I agree with Steven and 
Andrei, hierarchic containers are over-estimated.

Bjoern
PS
D celebrates meanwhile it s 10? birthday and phobos still lacks an 
collection lib. Ouch
Mar 23 2010
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 03/23/2010 05:58 PM, BLS wrote:
 Now How is it..
 We had a long and interesting discussion about ranges vs java/C whatever
 style(d) iterators. ... to bring in an idea.. what about
 implementing update events for collections. IMHO this is a very
 reasonable feature.
I think it's a great feature to be implemented on top of basic containers. Andrei
Mar 23 2010
parent reply BLS <windevguy hotmail.de> writes:
On 24/03/2010 00:04, Andrei Alexandrescu wrote:
 On 03/23/2010 05:58 PM, BLS wrote:
 Now How is it..
 We had a long and interesting discussion about ranges vs java/C whatever
 style(d) iterators. ... to bring in an idea.. what about
 implementing update events for collections. IMHO this is a very
 reasonable feature.
I think it's a great feature to be implemented on top of basic containers. Andrei
--On top of-- I guess it means inheritance Or do you think about template mixins ..pattern wise ?
Mar 23 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 03/23/2010 06:10 PM, BLS wrote:
 On 24/03/2010 00:04, Andrei Alexandrescu wrote:
 On 03/23/2010 05:58 PM, BLS wrote:
 Now How is it..
 We had a long and interesting discussion about ranges vs java/C whatever
 style(d) iterators. ... to bring in an idea.. what about
 implementing update events for collections. IMHO this is a very
 reasonable feature.
I think it's a great feature to be implemented on top of basic containers. Andrei
--On top of-- I guess it means inheritance Or do you think about template mixins ..pattern wise ?
Probably composition should suffice. Andrei
Mar 23 2010
parent BLS <windevguy hotmail.de> writes:
On 24/03/2010 01:02, Andrei Alexandrescu wrote:
 On 03/23/2010 06:10 PM, BLS wrote:
 On 24/03/2010 00:04, Andrei Alexandrescu wrote:
 On 03/23/2010 05:58 PM, BLS wrote:
 Now How is it..
 We had a long and interesting discussion about ranges vs java/C
 whatever
 style(d) iterators. ... to bring in an idea.. what about
 implementing update events for collections. IMHO this is a very
 reasonable feature.
I think it's a great feature to be implemented on top of basic containers. Andrei
--On top of-- I guess it means inheritance Or do you think about template mixins ..pattern wise ?
Probably composition should suffice. Andrei
Thanks Andrei. ahem composition is a pattern <g> ok, guess I have to wait for the sources.
Mar 23 2010
prev sibling next sibling parent reply Robert Clipsham <robert octarineparrot.com> writes:
On 23/03/10 22:58, BLS wrote:
 D celebrates meanwhile it s 10? birthday and phobos still lacks an
 collection lib. Ouch
Something I eagerly await :) I'm currently using tango's containers when I need them, porting them to D2... Fortunately they're all self contained so I didn't need to port the rest of tango to use them.
Mar 23 2010
parent BLS <windevguy hotmail.de> writes:
On 24/03/2010 00:25, Robert Clipsham wrote:
 On 23/03/10 22:58, BLS wrote:
 D celebrates meanwhile it s 10? birthday and phobos still lacks an
 collection lib. Ouch
Something I eagerly await :) I'm currently using tango's containers when I need them, porting them to D2... Fortunately they're all self contained so I didn't need to port the rest of tango to use them.
The latest release of Tango was indeed a step forward. (I never understand what fixed sized vectors in 0.97 are good for.) However, I am convinced that Andrei and Steven (Sometimes together maybe sometimes not ...but finally as a win) are brewing an outstanding collection library. Once we have this lib. enhancing Phobos, as well as porting C-ish software will be much easier. my 2 euro cents
Mar 23 2010
prev sibling parent "Igor Lesik" <curoles yahoo.com> writes:
"BLS" <windevguy hotmail.de> wrote in message 
news:hobh22$13t4$1 digitalmars.com...
 Now How is it..
 We had a long and interesting discussion about ranges vs java/C whatever 
 style(d) iterators.  ... to bring in an idea.. what about
 implementing update events for collections. IMHO this is a very reasonable 
 feature.

 (I am not talking about non-modifying events likewise cursor/snapshot 
 creation-events or cursor moving-events.. Interesting though )

 sample: database update events will force to pull data when needed and not 
 just in case.
 Indeed this is a high end feature, so what about
 create auto structures ..say.. backup structures on events..

 Our container(T) implementation can be based on a linked list implementing 
 a forward range and will feed our UnDo container(T) (based i.e. on remove 
 events)

 It would be very interesting to see how all these necessary D2 components 
 : ranges, std.algo, collection/container, aliases and delegates will come 
 together.

 ...I think our node like stuff (the core data structure) should be 
 implemented as structure, our container as class-interface pair where the 
 interface describes at least the range. I agree with Steven and Andrei, 
 hierarchic containers are over-estimated.

 Bjoern
 PS
 D celebrates meanwhile it s 10? birthday and phobos still lacks an 
 collection lib. Ouch
I am not sure I understand what is the source and destination of the events and what triggers them. But I was thinking that events could be used to invalidate ranges if the container changed, i.e. use events to implement "weak" coupling between container and range. I hope it does not sound too silly. Igor
Mar 24 2010