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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,86fd56abf3579c34 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,77f71d0bde4c5bb4 X-Google-Attributes: gid10db24,public From: gt2782a@prism.gatech.edu (Richard Ladd Kirkham) Subject: Re: What good is halting prob? Date: 1995/04/20 Message-ID: <3n6mru$s87@acmex.gatech.edu>#1/1 X-Deja-AN: 101283300 sender: gt2782a@prism.gatech.edu references: <1995Apr19.204744.21914@wdl.loral.com> <3n429h$pvu@acmex.gatech.edu> organization: Georgia Institute of Technology newsgroups: comp.lang.ada,comp.edu Date: 1995-04-20T00:00:00+00:00 List-Id: In article dewar@cs.nyu.edu (Robert Dewar) writes: >It is easy to construct examples where the effect depends on the parameter >passing mechanism: > > procedure X (a, b : in out string) is > begin > a(1) := 'x'; > if b(1) = 'x' then raise program_error; end if; > end x; > > G : string := "abc"; > H : string := "def"; > X (G, H); > >will raise program error if the strings are passed by reference but not >if they are passed by copy. In Ada 83 this program execution is erroneous Sorry. But I don't get it. When the branch condition is reached, b(1) = 'd' regardless of whether b is a reference or only a copy of H. -- Richard Ladd Kirkham Georgia Institute of Technology, Atlanta Georgia, 30332 uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt2782a Internet: gt2782a@prism.gatech.edu