www.digitalmars.com         C & C++   DMDScript  

D - Collections

reply "Matthew Wilson" <matthew stlsoft.org> writes:
Chaps

Just wanting some opinion on how to proceed with my nascent Registry API. It
has the following classes:

 Registry - contains the seven (static) registry keys, representing the root
keys found in a Win32 system
 Key
 Value
 KeySequence - the subkeys of a given Key
 ValueSequence - the values of a given Key

The problem I have, as mentioned in a prior post, is in the implementation
of the KeySequence and ValueSequence classes. AFAICT we have no established
models for collections in D, and I'm not keen to invest time in writing
collection classes for an inappropriate model and then have to rework as
standards evolve or are rewritten.

I see the following possibilities:

 1. Declare my own IEnumerable interface, program to that, and hope that
everyone adopts this as the D way of (non-template) collections. (FTR, my
gut feeling tells me that, whether right or wrong, we're going to end up
with both a generic Object-based collections model like Java's, and a
tightly based one similar to STL, what's got the working title of DTL until
someone gives it a better one.)
 2. Attempt to start some DTL, and emulate the functionality of the STLSoft
reg_key_sequence and reg_value_sequence types
(http://synesis.com.au/stlsoft/help/classstlsoft_1_1winstl__project_1_1basic
__reg__key__sequence.html,
http://synesis.com.au/stlsoft/help/classstlsoft_1_1winstl__project_1_1basic__reg__value__sequence.html)
 3. Define some hokey GetNumItems, GetItem(int index) methods, which are
just far too reminiscent of MFC for my liking.
 4. Wait until Walter gets foreach working, and write these two classes
according to the requirements of that mechanism. Walter, do you have an
approximate ETA on foreach?

Your thoughts will be most welcome.

Matthew
Aug 24 2003
parent reply "Walter" <walter digitalmars.com> writes:
I think you should wait for foreach. I plan to get to it soon, as it will
influence a lot of things.
Aug 24 2003
next sibling parent "Matthew Wilson" <dmd synesis.com.au> writes:
Cool. Will do.


"Walter" <walter digitalmars.com> wrote in message
news:bibnos$1njm$2 digitaldaemon.com...
 I think you should wait for foreach. I plan to get to it soon, as it will
 influence a lot of things.

Aug 24 2003
prev sibling parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
Do you have any ideas for a design yet?

Sean

"Walter" <walter digitalmars.com> wrote in message
news:bibnos$1njm$2 digitaldaemon.com...
 I think you should wait for foreach. I plan to get to it soon, as it will
 influence a lot of things.

Aug 25 2003
next sibling parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
I like walters initial syntax of

for (long l;longArray)

 (or something like that )
Charles

"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bicf93$2tne$1 digitaldaemon.com...
 Do you have any ideas for a design yet?

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:bibnos$1njm$2 digitaldaemon.com...
 I think you should wait for foreach. I plan to get to it soon, as it


 influence a lot of things.


Aug 25 2003
parent "Matthew Wilson" <matthew stlsoft.org> writes:
As long as it can handle getting, say, a key _and_ a value from an
associative container, I'll be happy. If not that, then a key/value pair.

"Charles Sanders" <sanders-consulting comcast.net> wrote in message
news:bidu4a$24fg$1 digitaldaemon.com...
 I like walters initial syntax of

 for (long l;longArray)

  (or something like that )
 Charles

 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:bicf93$2tne$1 digitaldaemon.com...
 Do you have any ideas for a design yet?

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:bibnos$1njm$2 digitaldaemon.com...
 I think you should wait for foreach. I plan to get to it soon, as it


 influence a lot of things.



Aug 25 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
Yes. I want to implement it first and try it out before looking too foolish
and posting it!

"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bicf93$2tne$1 digitaldaemon.com...
 Do you have any ideas for a design yet?

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:bibnos$1njm$2 digitaldaemon.com...
 I think you should wait for foreach. I plan to get to it soon, as it


 influence a lot of things.


Aug 26 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
That never stops me!  ;)

Sean

"Walter" <walter digitalmars.com> wrote in message
news:bif5ih$vjq$1 digitaldaemon.com...
 Yes. I want to implement it first and try it out before looking too

 and posting it!

 "Sean L. Palmer" <palmer.sean verizon.net> wrote in message
 news:bicf93$2tne$1 digitaldaemon.com...
 Do you have any ideas for a design yet?

 Sean

 "Walter" <walter digitalmars.com> wrote in message
 news:bibnos$1njm$2 digitaldaemon.com...
 I think you should wait for foreach. I plan to get to it soon, as it


 influence a lot of things.



Aug 26 2003