From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 9 Oct 92 02:38:07 GMT From: simonson@beaver.cs.washington.edu (Kevin Simonson) Subject: Does the LRM permit parameter passing by reference? Message-ID: <1992Oct9.023807.20641@beaver.cs.washington.edu> List-Id: I was under the impression that Ada made local copies of parameter values when a procedure was called. However my Verdix compiler apparently does calls by reference when the call is for a string value, as demonstrat- ed by the script file below. Notice how the parameter "COPY" (which Ada won't allow code to alter inside the procedure) changes its value from the first "put_line" to the second. Is it legal for Ada to allow this parameter to change in the middle of the procedure, or have I found a bug? ---Kevin ph^guru} cat reference_demo_p.a with text_io; procedure REFERENCE_DEMO_P is ORIGINAL : string(1..3); procedure DEMO_P (COPY : string) is begin text_io.put_line (COPY); ORIGINAL(1..COPY'length) := COPY; text_io.put_line (COPY); end DEMO_P; begin ORIGINAL := "abc"; DEMO_P (ORIGINAL(2..3)); end REFERENCE_DEMO_P; ph^guru} reference_demo_p bc cc ph^guru} exit ph^guru} script done on Thu Oct 8 08:53:41 1992