Map
Index
Random
Help
Topics
th

Topic: parameter passing by reference

topics > computer science > data > Group: parameters



Topic:
aliasing
Topic:
function results
Topic:
input or output parameters
Topic:
parameter passing by argument list
Topic:
parameter passing by name
Topic:
parameter passing by value
Topic:
parameter passing by value-result
Topic:
pointers to data
Topic:
sending an object across a network
Topic:
variable as reference to a value

Summary

In parameter passing by reference, or call-by-reference, parameters are replaced by the argument's address. For input-only parameters, passing by reference is the same as passing by value. Output parameters are identified with variable names external to the procedure; they can't be temporaries. A modification is CLU's parameter passing by sharing. Here parameters are bound to the same object as the arguments are bound to. Changing the parameter's binding does not change the argument. (cbb 5/80)
Subtopic: pass by reference up

Quote: a function declares its bound variables (i.e., its formal parameters) as R-values or L-values; call by value or reference [»straC8_1967]
QuoteRef: kostCH_1974 ;;370 parameters passed by name or reference .
Quote: in CLU, a parameter is bound to the same object as the argument is bound to; changing the binding does not effect the argument [»liskBH2_1976, OK]
Quote: a reference argument to an environment is interpreted whenever the argument changes [?] [»hansDR5_1978]
Note: a parameter is an object field, a reference to a pointer; value semantics is an optimization [»cbb_1990, OK]
Quote: restrict stack pointers to call-by-reference; can not store in the heap or globals [»necuGC5_2005]

Subtopic: array argument as reference up

Quote: in C, an array argument is converted to a pointer; arrays are effectively passed by reference [»ritcDM7_1978c]

Subtopic: reference parameters as constants up

Quote: reference arguments should use 'const' if the argument is not modified; allows literal and expression arguments; improves readability
Quote: try to avoid functions that modify call-by-reference arguments. They make a program harder to read [»stroB_1991]

Subtopic: call-by-reference and multi-processing up

Quote: call-by-reference creates shared memory between caller and callee; if multi-threaded, information can transfer at any time [»grimR2_2001]
Quote: reference parameters across processors either require expensive messages or access delays
[»donnMD_1987, OK]

Related Topics up

Topic: aliasing (28 items)
Topic: function results (7 items)
Topic: input or output parameters (5 items)
Topic: parameter passing by argument list (6 items)
Topic: parameter passing by name (11 items)
Topic: parameter passing by value (5 items)
Topic: parameter passing by value-result (10 items)
Topic: pointers to data (55 items)
Topic: sending an object across a network (11 items)
Topic: variable as reference to a value
(21 items)

Updated barberCB 10/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.