From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,47bc849aad30d586 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-30 06:23:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-x2.support.nl!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: A standard package for config files is needed Date: Wed, 29 May 2002 15:49:02 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: <4519e058.0205291059.737616ec@posting.google.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1022701745 25764 136.170.200.133 (29 May 2002 19:49:05 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 29 May 2002 19:49:05 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:25002 Date: 2002-05-29T19:49:05+00:00 List-Id: Well, my understanding of the original post was that it was a hypothetical "Hey! Ada programs have to initialize themselves, so why don't we build something to interpret initialization files or something similar to the registry???" Not that it had to duplicate exactly what the registry does - although there may be those who would want that. So if you've got a general "Initialization" need - why could you not use Maps? You look up something based on a key. The "something" could be a string or it could be a record or whatever seemed to make sense for the actual implementation. Decide what requirements need to be satisfied then build the structure to suit that. If you want a tree-like structure, it might be viewed as a Map of Maps. My idea was that if you had Maps implemented, you could build a registry-like structure out of it as a basic building block & end up with another useful component for Grace. If we had a "Registry" (I use the term in the loose sense) package that was built from Maps, it might make sense to build a "Registry Editing" package - although this gets you into having to think about what sort of user interface you want to support. It could suck it up and spit it out to a text file, but I'm not sure I'd need that sort of behavior so long as my program could set configuration information and then retrieve it next time it started up. (Streams might be good enough for me.) I could see how others would likely disagree, so I wouldn't consider it a hard requirement - but then you get into arguing about what sort of format it should have. XML has advantages in terms of it being able to get infinitely complex as needed, but then you need a DOM as well as something to interpret it as a "Registry". Just a thought as to how to make Grace be more useful..... MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com "Ted Dennison" wrote in message news:4519e058.0205291059.737616ec@posting.google.com... > > If you were to use a Grace-style map, I think you'd have to view every > value as a string (most likely, an Ada.Strings.Unbounded_String). His > example showed numbers, which presumably folks would want to > manipulate as numbers, not strings. Then again, Ada's 'value makes it > pretty easy to do the transformation. However, the user would have to > handle any errors due to the value being the wrong type. > > Its tough to tell from nothing more than an uncommented example, but > it looked like there was a wee bit more structure to it than just a > bunch of attribute/value pairs. If that's the case, Maps could > probably not be used, and a special structure might be required. It > would be nice to know how much structure there really should be, and > what it could be. > > The way the NT registry works, Keys are stored in a hierarchy (think > of them as directories), and each one may have multiple "values". A > value has 3 attributes, its name, its *type*, and its actual value. > There are lots of different possible types, but in general they are > all a pain to deal with. :-) Most folks just stick to the string or > string array types. > > > Assuming we get a Grace component to do this, it might even make a nice > > extension to the Grace library - a descendent of Maps that handles > > If we are talking of it as a standard Ada thing, then I agree.