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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7624df5e57d09688 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-03 09:08:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.columbus.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3CFB94A7.A455B8DD@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: config files proposal References: <3CFA8E42.B7844253@san.rr.com> <4519e058.0206030656.34c424ff@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 03 Jun 2002 16:08:47 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1023120527 66.75.151.160 (Mon, 03 Jun 2002 09:08:47 PDT) NNTP-Posting-Date: Mon, 03 Jun 2002 09:08:47 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:25260 Date: 2002-06-03T16:08:47+00:00 List-Id: Ted Dennison wrote: > > > Question: Are keys case-sensitive? > > > > Good point. I think I'll go with the Ada identifier model and say > > "no". > > I agree wholeheartedly, for the same reason. I think they should be case sensitive unless there's a standard way of converting uppercase unicode to lowercase unicode in Ada's libraries. Remember that (for example) you'll probably want to store this stuff in a Map, implying a hashtable perhaps, meaning you'll need to convert between whatever is supplied and either upper or lower case, and do so in the same way a native speaker of the language would do so. Remember too that (for example) the lower-case version of some German words don't even have the same length as the upper-case version. And I'm not even sure there's general agreement on whether uppercase letters in French have the accent included or not. And I don't even *know* if there is the equivalent with different Chinese, Japanese, or Cyrilic characters, for example. While it's admirable to ignore the case of the letters, I think trying to implement a general "to_lower" that'll handle Unicode properly is going to be more of a nightmare than writing the entire rest of the config file parser. Unless you restrict the keys to US-ASCII, that is. Just something to consider. > Perhaps it would be better to allow for some kind of "chaining" of > configuration objects? That way items not found in the first > configuration might be found in later ones. Yes, I think that's a good way to go also. At least, that's how I do it. :-) I think there should also be some sort of tag at the front of each file saying it's an Ada config file, even if only -- Ada Grace.Config file V1.0 -- Do not hand-edit. so one could check you've found a proper file and know what version it is. > > Yes. Actually, I think the file is OS closed at the end of Open, after > > the data is read in. > > *That* sounds like an implementation detail to me. Its a good idea > perhaps, but still an implementation detail. I think it's an important detail for systems where having a file open changes the semantics for other users. If, for example, you leave it open after you write it, it's possible I won't be able to read it. If you leave it open after reading it, I may be dedicating resources on the file server to keeping track of it (assuming it's centrally served, for example). Closing it each time would make it easier to reason about multiple users using the same config file, and the overhead of reopening it should be minimal, given it's a config file. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. ** http://home.san.rr.com/dnew/DNResume.html ** ** http://images.fbrtech.com/dnew/ ** My brain needs a "back" button so I can remember where I left my coffee mug.