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-Thread: 103376,f890526de6a8a218 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How to detect OS type and version? Date: 16 Oct 2005 11:59:57 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <20051013115001.60b6a695@pscube.informatik.uni-stuttgart.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1129478397 5457 192.74.137.71 (16 Oct 2005 15:59:57 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 16 Oct 2005 15:59:57 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5726 Date: 2005-10-16T11:59:57-04:00 List-Id: Ray Blaak writes: > What I would do in your case is to make my own project-specific enumerated > type and decide the appropriate current literal value at startup based on the > the string-based values returned from querying the OS. In my case, we have an enumeration type, and we compile in the value. (That is, we have a package spec with three versions, and the build scripts pick the right one.) There's no need to query anything at run time (in my project). > I guess what I care about is that the built in OS query that would live > somewhere under the System or Ada hierarchy would not return an enumerated > type, but rather a string. > > That is, the enumeration should not be built into the language, since > it is not at all a stable enough set of values for the long > term. Imagine being able to code to an updated set only every 10 > years, which seems to be Ada's upgrade cycle. I agree that an enum type would not work here, as a language feature. But neither would a string or anything else -- there is no solution at the language level. This issue has to be solved by each project, I think. - Bob