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,9f3d09bde7b33b5d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-09 07:54:16 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Pass by reference Date: 09 Apr 2004 15:50:05 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <19b0e504.0404080652.4eab9f80@posting.google.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1081522455 3682 62.49.19.209 (9 Apr 2004 14:54:15 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 9 Apr 2004 14:54:15 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:6907 Date: 2004-04-09T15:50:05+01:00 List-Id: "Steve" writes: > I am only aware of one (obscure) case in Ada where passing by > reference versus passing by value makes a difference. It has come > up on this newsgroup before. I had (in the full view) type Socket is record Handle : Interfaces.C.int; end record; and, on failure, my Read operation woudl close() the Handle in its "in out" Socket parameter, set it to -1, and raise an exception. But the actual Socket didn't get altered, because it wasn't by-reference. So I had to make it a tagged type (couldn't be limited, for some reason I forget now). -- Simon Wright 100% Ada, no bugs.