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.6 required=5.0 tests=BAYES_05,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f894972725d7613 X-Google-Attributes: gid103376,public From: hware@cs.wvu.edu (Henry Ware) Subject: Ada strangeness or bug in Gnat? Date: 1996/11/06 Message-ID: #1/1 X-Deja-AN: 194756168 sender: news@cerc.wvu.edu organization: West Virginia University, Computer Science reply-to: hware@cs.wvu.edu newsgroups: comp.lang.ada Date: 1996-11-06T00:00:00+00:00 List-Id: Hi, Heres some sample code: ---Cut Here with Ada.Text_Io, Ada.Integer_text_io; use Ada.Text_Io, Ada.Integer_text_io; procedure foo3 is type Int2_Array is array (1..2) of Integer; -- Return the same values sorted in ascending order procedure Sort_Int2 (Unsorted : in Int2_array; Sorted : out Int2_array) is begin if ( Unsorted(1) < Unsorted(2) ) then Sorted(1):=Unsorted(1); Sorted(2):=Unsorted(2); else Sorted(1):=Unsorted(2); Sorted(2):=Unsorted(1); end if; end Sort_Int2; Z: Int2_array; begin Z(1):=2; Z(2):=1; -- This should(?) act like a swap Sort_Int2(Z(1..2),Z(1..2)); -- ...but actually returns 1,1 Put(Z(1)); New_Line; Put(Z(2)); New_Line; end foo3; --Cut Here The same code works as expected if arrays are not used: ie the procedure takes 4 arguments. Is this correct? We are using Gnat3.03. Thanks, -- Henry Ware hware@cs.wvu.edu % rm file rm: remove file? y rm: you realize that you'll never get it back? y rm: wouldn't you rather keep it? n rm: ok, now let me get this straight. you voted for clinton last election and you want me to trust your judgment on deleting this file. personally, i don't feel you're qualified for a decision of this caliber. how about we run xeyes instead? n rm: are you absolutely positively sure that you want to remove this file? y rm: hesitation detected in reply. file not removed.