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,13b19740d69cbdc2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-14 20:36:30 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc04.POSTED!not-for-mail From: "Jeff C," Newsgroups: comp.lang.ada References: <20031010074015.761204C40C1@lovelace.ada-france.org> <94skovca8efqisiip65q37of63g28n1284@4ax.com> Subject: Re: Modes (was unbounded_string) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <1h3jb.779716$uu5.136348@sccrnsc04> NNTP-Posting-Host: 66.31.4.164 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc04 1066188989 66.31.4.164 (Wed, 15 Oct 2003 03:36:29 GMT) NNTP-Posting-Date: Wed, 15 Oct 2003 03:36:29 GMT Organization: Comcast Online Date: Wed, 15 Oct 2003 03:36:29 GMT Xref: archiver1.google.com comp.lang.ada:875 Date: 2003-10-15T03:36:29+00:00 List-Id: "Warren W. Gay VE3WWG" wrote in message news:Mb2jb.8531> Well, C returns a pointer, if you use getenv(2). However, there is no reason > that ACT could not have converted this into a normal Ada string, which is > what I would have expected. Even in C, you are really expected to use > putenv or setenv to make a change. However, programmers have been > known to "cheat" and modify the string that the getenv pointer points to, > which works provided that the string does not require more length. But > even in C terms, IMHO, this is a bad practice. > Never assume that there is "no reason" for ACT or anyone else for that matter doing something without at least quickly looking at it. The start of the package says -- This package tends to use fairly low-level Ada in order to not bring -- in large portions of the RTL. For example, functions return access -- to string as part of avoiding functions returning unconstrained types. gnat.os_lib is useful but it probably should not be generally used within you code. It certainly would be nice if ACT provided a "thicker" version of the package (and perhaps if a few customers ask for it they will) but it appears that they had their reasons whey they originally set this up.