comp.lang.ada
 help / color / mirror / Atom feed
From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe)
Subject: Re: Call by reference vs. call by value
Date: 1996/07/30
Date: 1996-07-30T00:00:00+00:00	[thread overview]
Message-ID: <4tke20$bja@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: DuyGpI.D5J@world.std.com


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.




  reply	other threads:[~1996-07-30  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-20  0:00 Call by reference vs. call by value Christopher Felaco
1996-07-20  0:00 ` Robert Dewar
1996-07-21  0:00   ` Robert A Duff
1996-07-21  0:00     ` Robert Dewar
1996-07-22  0:00       ` Robert A Duff
1996-07-23  0:00         ` Peter Amey
1996-07-23  0:00           ` Robert A Duff
1996-07-27  0:00             ` Peter Morris
1996-07-28  0:00               ` Robert A Duff
1996-07-23  0:00           ` Robert Dewar
1996-07-24  0:00             ` Robert A Duff
1996-07-24  0:00           ` Richard A. O'Keefe
1996-07-22  0:00   ` Karl Cooper {46901}
1996-07-22  0:00     ` Robert Dewar
1996-07-22  0:00   ` Felaco
1996-07-22  0:00     ` Robert Dewar
1996-07-22  0:00     ` Robert A Duff
1996-07-30  0:00       ` Richard A. O'Keefe [this message]
1996-07-30  0:00   ` Felaco
1996-07-31  0:00     ` Robert A Duff
1996-08-02  0:00     ` Robert Dewar
1996-08-03  0:00     ` JP Thornley
1996-08-05  0:00       ` Roderick Chapman
1996-07-20  0:00 ` James A. Krzyzanowski
1996-07-20  0:00   ` Robert Dewar
1996-07-21  0:00 ` Robert A Duff
1996-07-21  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-07-25  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-07-26  0:00 ` Peter Amey
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox