www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DTL container wishlist

reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
[Sorry for the post onto the D forum, but I'm going to do that for a little
while
longer, until the DTL forum achieves its own momentum.]

Not that I'm promising that all suggestions will get in the first version, but
I'd like to know what containers people would like to see as part of the
standard
library.

For any suggestions that do not have direct analogues in the C++ standard
library, descriptions of/links to implementations would be helpful.

I'm not planning to put in huge amounts of esoteric containers, but there are
certainly things that are missing from the C++ standard library that are missed.

Cheers



-- 
Matthew Wilson

Contributing editor, C/C++ Users Journal
    (www.synesis.com.au/articles.html#columns)
STLSoft moderator
    (http://www.stlsoft.org)

"I can't sleep nights till I found out who hurled what ball through what
apparatus" -- Dr Niles Crane

-------------------------------------------------------------------------------
May 05 2004
next sibling parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Matthew wrote:

[Sorry for the post onto the D forum, but I'm going to do that for a little
while
longer, until the DTL forum achieves its own momentum.]

Not that I'm promising that all suggestions will get in the first version, but
I'd like to know what containers people would like to see as part of the
standard
library.

For any suggestions that do not have direct analogues in the C++ standard
library, descriptions of/links to implementations would be helpful.

I'm not planning to put in huge amounts of esoteric containers, but there are
certainly things that are missing from the C++ standard library that are missed.

Cheers
  
- Singular linked lists (this was mentioned before). -- -Anderson: http://badmama.com.au/~anderson/
May 05 2004
next sibling parent Daniel Horn <hellcatv hotmail.com> writes:
I use multimaps a lot in a game I was looking to port to D.
I use the multimap iterator to contain an object in the multimap... so 
the game requires map insertion and deletion that do not destroy the 
iterators already in the multimap. (this is currently how STL is setup)

I also use maps a lot... it's something that's currently sorely missed 
in D (though hashtables are very useful for certain things, being able 
to go through objects in some order is quite important for collision 
detection)

sets are useful, but they're just maps ;-)

the ability to directly use the underlying tree structure of the 
multimap (i.e. having a predefined balanced or nearly balanced tree 
class) would be quite useful for collision detection for example




J Anderson wrote:

 Matthew wrote:
 
 [Sorry for the post onto the D forum, but I'm going to do that for a 
 little while
 longer, until the DTL forum achieves its own momentum.]

 Not that I'm promising that all suggestions will get in the first 
 version, but
 I'd like to know what containers people would like to see as part of 
 the standard
 library.

 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.

 I'm not planning to put in huge amounts of esoteric containers, but 
 there are
 certainly things that are missing from the C++ standard library that 
 are missed.

 Cheers
  
- Singular linked lists (this was mentioned before).
May 05 2004
prev sibling parent Sean Kelly <sean ffwd.cx> writes:
J Anderson wrote:
 
 - Singular linked lists (this was mentioned before).
These are already in the C++ STL as an adaptor so I assume it would be in the DTL as well. Is there a spec of what we've got so far, or something about basic design principles? Work has kept me too darn busy to play much with D but I'd be interested in seeing how things are going so far. Sean
May 05 2004
prev sibling next sibling parent reply mike parker <mike aldacron.com> writes:
Matthew wrote:

 Not that I'm promising that all suggestions will get in the first version, but
 I'd like to know what containers people would like to see as part of the
standard
 library.
I'd love to see a HashTable. In C++, it is not part of the standard and is implemented as a vendor-specific extension.
May 06 2004
parent reply mike parker <mike aldacron.com> writes:
mike parker wrote:
 
 I'd love to see a HashTable. In C++, it is not part of the standard and 
 is implemented as a vendor-specific extension.
Hmm. Then again, is there a use for a HashTable above and beyond what can be done with associative arrays?
May 06 2004
parent reply Mike Wynn <one_mad_alien hotmail.com> writes:
On Thu, 06 May 2004 10:58:14 +0000, mike parker <mike aldacron.com>
wrote:

mike parker wrote:
 
 I'd love to see a HashTable. In C++, it is not part of the standard and 
 is implemented as a vendor-specific extension.
Hmm. Then again, is there a use for a HashTable above and beyond what can be done with associative arrays?
I'm not 100% sure about assoc arrays but I still sometimes use class HashTable(K,V) { V[K] map; put(K key, V value ) { map[key]=value; } V get( K key) { return map[key]; } } and class Vector(V) { V[] data; opCatAssign(V v) { data ~= v; } to give Java like behaviour when passed to a function/method i.e. changes made by the callee effect the object held by the caller. Mike
May 06 2004
parent Ben Hinkle <bhinkle4 juno.com> writes:
 to give Java like behaviour when passed to a function/method i.e.
 changes made by the callee effect the object held by the caller.
declaring parameters as "inout" will do the same thing - but you have to pass an l-value.
May 06 2004
prev sibling next sibling parent Ben Hinkle <bhinkle4 juno.com> writes:
- a linked list (double)
- a red-black tree for sorted associative containers (eg, maps, set) I'm up
in the air if we need to explicitly define set,map,multiset,multimap. I'm
tempted to just have the tree and say with value type of void it is a set,
with a counter it can be a multi-set, and with a dynamic or associative
array it is a multi-map.

- some helper functions for dealing with arrays like "reserve". It is still
true that setting the length of a dynamic array to zero (or from zero) will
wipe out any reserve but it's better than nothing.

Here's a meta-question: what should go in std, what should go in etc and
what should go outside the dmd.zip distribution like on dsource?
May 05 2004
prev sibling next sibling parent reply Jan Knepper <jan smartsoft.us> writes:
Matthew wrote:
 [Sorry for the post onto the D forum, but I'm going to do that for a little
while
 longer, until the DTL forum achieves its own momentum.]
Please do NOT do that. DTL will gain it's momentum as people will see in their news readers that there are new messages in the group. Besides that it takes double the resources. AFAIK cross posting as it is called is NOT allowed in the Borland forums. I would not like to go that far, but I would like to discourage it. Thanks! Jan -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
May 05 2004
parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
Ok. Will do.

;)

"Jan Knepper" <jan smartsoft.us> wrote in message
news:c7c79t$86f$1 digitaldaemon.com...
 Matthew wrote:
 [Sorry for the post onto the D forum, but I'm going to do that for a little
while
 longer, until the DTL forum achieves its own momentum.]
Please do NOT do that. DTL will gain it's momentum as people will see in their news readers that there are new messages in the group. Besides that it takes double the resources. AFAIK cross posting as it is called is NOT allowed in the Borland forums. I would not like to go that far, but I would like to discourage it. Thanks! Jan -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
May 05 2004
prev sibling next sibling parent reply Ant <duitoolkit yahoo.ca> writes:
On Thu, 06 May 2004 09:00:20 +1000, Matthew wrote:

 [Sorry for the post onto the D forum, but I'm going to do that for a little
while
 longer, until the DTL forum achieves its own momentum.]
 
 Not that I'm promising that all suggestions will get in the first version, but
 I'd like to know what containers people would like to see as part of the
standard
 library.
 
 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.
 
 I'm not planning to put in huge amounts of esoteric containers, but there are
 certainly things that are missing from the C++ standard library that are
missed.
 
 Cheers
Do to your other contributions I'm going to assume that DTL will be released on the Synesis License. That's absolutelly fine with me. I have no problem at all with that, no problem at all as long as I'm not forced to download the source code to use the final product. I just want to clarify: are these contributions in the form of wishes (i.e ideas and priorities - at least) to be considered donnations to Synesis? Ant
May 05 2004
parent Ant <Ant_member pathlink.com> writes:
In article <pan.2004.05.06.02.36.41.741820 yahoo.ca>, Ant says...
On Thu, 06 May 2004 09:00:20 +1000, Matthew wrote:

 [Sorry for the post onto the D forum, but I'm going to do that for a little
while
 longer, until the DTL forum achieves its own momentum.]
 
 Not that I'm promising that all suggestions will get in the first version, but
 I'd like to know what containers people would like to see as part of the
standard
 library.
 
 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.
 
 I'm not planning to put in huge amounts of esoteric containers, but there are
 certainly things that are missing from the C++ standard library that are
missed.
 
 Cheers
Do to your other contributions I'm going to assume that DTL will be released on the Synesis License. That's absolutelly fine with me. I have no problem at all with that, no problem at all as long as I'm not forced to download the source code to use the final product. I just want to clarify: are these contributions in the form of wishes (i.e ideas and priorities - at least) to be considered donnations to Synesis?
Matthew, It's prefectly ok if that's the case! Contributions are also to a better DTL. just let's make things clear. maybe even my assumptions are wrong. I'm not interesting in looking at code with that clause (see other post) on the Synesis license or donnating my work anonymously to Synesis but others might be. I said before that I would prefer this to be an open project but having it on the Synesis license is the second best thing (but I'm still concerned with access to the source code, I don't want to be forced to download it to use the libs). Ant
May 06 2004
prev sibling next sibling parent reply Chris Lawson <cl mangler.tinfoilhat.ca> writes:
Matthew wrote:

 [Sorry for the post onto the D forum, but I'm going to do that for a little
while
 longer, until the DTL forum achieves its own momentum.]
 
 Not that I'm promising that all suggestions will get in the first version, but
 I'd like to know what containers people would like to see as part of the
standard
 library.
 
 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.
 
 I'm not planning to put in huge amounts of esoteric containers, but there are
 certainly things that are missing from the C++ standard library that are
missed.
Will you be receptive to adding in weird containers if people write and submit them to you? Chris
May 06 2004
next sibling parent reply Ant <Ant_member pathlink.com> writes:
In article <c7ecp6$lin$1 digitaldaemon.com>, Chris Lawson says...
Matthew wrote:
[...]
 
 Not that I'm promising that all suggestions will get in the first version, but
 I'd like to know what containers people would like to see as part of the
standard
 library.
 
 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.
 
 I'm not planning to put in huge amounts of esoteric containers, but there are
 certainly things that are missing from the C++ standard library that are
missed.
Will you be receptive to adding in weird containers if people write and submit them to you? Chris
I'm curious to see how he replies to your offer. Matthew is having a bad (as I see it) actitude on relation to this DTL project. As I see it he want's to be <drums><echo>The Man That Created DTL</echo></drums> (a better title would be "the man that ripped STL") but he also want's help doing. If that is true is (if not illegal) at least unetical to ask for contributions. of course this is my impression and Matthew is doing a bad job to clarify this - I might be wrong of course. I propose that we start an independent open project: ANT the Alternative New Templateslibrary It would be LGPLed. Your contribution could be the first. Ant
May 07 2004
next sibling parent Lars Ivar Igesund <larsivar igesund.net> writes:
[To D NG: Thread started in D.dtl]

Ant wrote:

 of course this is my impression and Matthew is doing a bad
 job to clarify this - I might be wrong of course.
I agree that Matthew need to clarify his (and Synesis') position here. And probably Walter too. I might add to your ANT plans that anyone can make their own implementation of an API. If the API of phobos is considered standard, but with an unacceptable license, then a reimplementation (clean room) can be made and released under e.g. LGPL. The only problem is that you might not be legally entitled to call it Phobos. D Standard Library shouldn't be a problem though. When I some while ago thought about a standards group for Phobos, then such free implementations of the API was one of the (possibly not forwarded) ideas I had for it. Lars Ivar Igesund
May 07 2004
prev sibling parent reply John Reimer <brk_6502 NOSP_AM.yahoo.com> writes:
While I believe Matthew is more than capable of looking after himself, 
I don't understand the need for such severe invectives against him, Ant. 
   You've brought this up several times without eliciting a response 
from him.  Now it just looks like you're taunting him for a reply.

Yeah, he wants to be the man that creates DTL.  I would too.  It doesn't 
mean it's going to be THE DTL.  He's taking a gamble on that.  So far as 
he knows it might get wripped apart the moment he releases it.

Part of the problem with this "closed" source feel is that he and Walter 
appear to be in cahoots.  If that's so, you'd better blame Walter too 
for patronizing him in the matter.

If we really want to guarantee a open DTL project, I suggest that 
someone start one on dsource.org.  Then if Matthew's DTL turns out 
useful, we can borrow ideas from it ;-).  Otherwise, those that don't 
want to show initiative can wait for what Matthew has to offer.
May 07 2004
parent Ant <Ant_member pathlink.com> writes:
In article <c7g725$glg$1 digitaldaemon.com>, John Reimer says...
I don't understand the need for such severe invectives against him, Ant. 
thanks for the advice. Ant
May 07 2004
prev sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
"Chris Lawson" <cl mangler.tinfoilhat.ca> wrote in message
news:c7ecp6$lin$1 digitaldaemon.com...
 Matthew wrote:

 [Sorry for the post onto the D forum, but I'm going to do that for a little
while
 longer, until the DTL forum achieves its own momentum.]

 Not that I'm promising that all suggestions will get in the first version,
but
 I'd like to know what containers people would like to see as part of the
standard
 library.

 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.

 I'm not planning to put in huge amounts of esoteric containers, but there are
 certainly things that are missing from the C++ standard library that are
missed.
 Will you be receptive to adding in weird containers if people write and
 submit them to you?
Of course. :) The whole idea is to create a model for a template library. For myself, the most important aspect is to define the enumeration standards - this is what I've been doing so far, and what I'm currently waiting on Walter for mixins for. Second to that is to arbitrate over which containers make it into the std.dtl package. I imagine this will be mainly a demand-driven thing, subject to Walter's approval, though I would hope to have an opinion on this. Maybe I've not made myself clear enough times on this. I don't propose to be the one writing all the containers, and I have no intention of doing so. What I'm trying to do is layout a common framework for containers, and hope that others adopt that framework and are able to use it in writing their own containers. Whether such containers, weird or normal, would make it into the DTL, or remain as parts of other - Phobos or non-Phobos - packages, would be on a case-by-case basis, and would, I expect, be determined by Walter, and the general community. It's my belief that this is the best approach for getting a useful, standard, powerful library that rivals the STL in power, but is much easier to understand, use and extend.
May 07 2004
prev sibling parent "Ivan Senji" <ivan.senji public.srce.hr> writes:
"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c7brm0$2p25$3 digitaldaemon.com...
 [Sorry for the post onto the D forum, but I'm going to do that for a
little while
 longer, until the DTL forum achieves its own momentum.]

 Not that I'm promising that all suggestions will get in the first version,
but
 I'd like to know what containers people would like to see as part of the
standard
 library.

 For any suggestions that do not have direct analogues in the C++ standard
 library, descriptions of/links to implementations would be helpful.

 I'm not planning to put in huge amounts of esoteric containers, but there
are
 certainly things that are missing from the C++ standard library that are
missed.
 Cheers
I hope DTL will also have some algorithms like sort,find,findfirstof..., min,max templates... They are very usefull in STL.
May 07 2004