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-11 00:18:37 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Modes (was unbounded_string) Date: 11 Oct 2003 08:16:39 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <20031010074015.761204C40C1@lovelace.ada-france.org> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1065856717 13724 62.49.19.209 (11 Oct 2003 07:18:37 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 11 Oct 2003 07:18:37 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:654 Date: 2003-10-11T08:16:39+01:00 List-Id: Dmitry A. Kazakov writes: > declare -- I need the value of QUERY_STRING here > Temp : String renames Getenv ("QUERY_STRING").all; > -- Temp is an alias to the env-string. You cannot modify it. > -- Yet it is not a pointer. An analogue would be C++ reference > begin > ... -- Doing with Temp everything I can to do to > -- a constant String > end; -- I don't need it anymore Actually you *can* modify it: with Ada.Text_IO; use Ada.Text_IO; with GNAT.OS_Lib; use GNAT.OS_Lib; procedure Env is Temp : String renames Getenv ("COLDFRAME").all; begin Temp (1) := 'x'; Put_Line (Temp); end Env; then smaug.pushface.org[5]$ COLDFRAME=foo ./env xoo (GNAT 3.16a1) Should GNAT.OS_Lib.Getenv have been defined as returning a constant string access? type Constant_String_Access is access constant String;