Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
August 24, 2003 Collections | ||||
---|---|---|---|---|
| ||||
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 |
August 25, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | I think you should wait for foreach. I plan to get to it soon, as it will influence a lot of things. |
August 25, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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. > > |
August 25, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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. |
August 25, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | 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 will > > influence a lot of things. > > |
August 25, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Sanders | 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 > will > > > influence a lot of things. > > > > > > |
August 26, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | 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 will > > influence a lot of things. > > |
August 26, 2003 Re: Collections | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 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 > will > > > influence a lot of things. |
Copyright © 1999-2021 by the D Language Foundation