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,8e64f4db20d57eb5 X-Google-Attributes: gid103376,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Call by reference vs. call by value Date: 1996/07/30 Message-ID: <4tke20$bja@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 170989130 references: <31F10E50.726@egr.uri.edu> organization: Comp Sci, RMIT, Melbourne, Australia nntp-posting-user: ok newsgroups: comp.lang.ada Date: 1996-07-30T00:00:00+00:00 List-Id: bobduff@world.std.com (Robert A Duff) writes: >Yes, that's one reasonable solution. It shouldn't be a pragma, but >should use some sensible syntax. Some Pascal compilers do something >like this -- there are by-value parameters, and CONST parameters (which >are by-reference, but still in-mode), and VAR parameters (which are >by-ref/in-out). Maybe CONST parameters are part of standard Pascal now; >I don't know. Anyway, this solution has some problems (passing of >components of packed things, forcing the programmer to specify something >that *usually* doesn't matter, ..) In ISO 10206 (ISO Pascal Extended) there are x: T; -- by value, local copy modifiable var x: T; -- by reference, original modifiable protected x: T; -- as if by value, local copy not modifiable protected var x: T; -- as if by reference, original not modifiable 'out' or 'in out' would have to be implemented as 'var', which specifies by-reference. 'in' corresponds to either protected value or protected var, both of which are more specific than in Ada. I am somewhat surprised that they didn't include protected pointers. -- Fifty years of programming language research, and we end up with C++ ??? Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.