Map
Index
Random
Help
Topics
th

Topic: parameter passing by name

topics > computer science > data > Group: parameters



Group:
procedure and type-valued variables

Topic:
binding names to variables or expressions
Topic:
binding of names to objects
Topic:
macros
Topic:
named constants and expressions
Topic:
names as place holders
Topic:
parameters as argument place holders
Topic:
parameter passing by reference
Topic:
procedure valued variables

Summary

In parameter passing by expression, or 'call by name', each parameter is replaced by the corresponding argument's text or literal expression. Since the text is re-evaluated each time the parameter is referenced, passing by expression is the same as passing a function. This mode is expensive to implement and has many unexpected side effects due to embedding an expression into one environment from another. For variables, parameter passing by name is equivalent to parameter passing by reference. (cbb 5/80)

Jensen's device uses call-by-name to get procedures for nested summations. Macro calls typically use call by name. (cbb 1/90)

Subtopic: usefulness of call-by-name up

Quote: should not emphasize security; it disallows useful features such as call-by-name [»dahlOJ_1967]

Subtopic: call-by-name as a procedure argument up

Quote: a call-by-name is passing a procedure [»bekiH_1971, OK]
Quote: in call-by-name, arguments are evaluated only when needed; i.e., on insertion into replacement text [»browPJ_1969]
Quote: in call-by-expression, substitute expression for each occurrence of parameter [»ledgHF9_1971, OK]
Quote: call-by-value if evaluate arguments before function, call-by-name if evaluate on each reference; use left-to-right evaluation to support extensions under call-by-value [»reynJC8_1972]

Subtopic: call-by-name as constants up

Quote: a constant denotation as an argument is same as call-by-name; not evaluated until applied [»demeA3_1979]
QuoteRef: kostCH_1974 ;;370 parameters passed by name or reference .
QuoteRef: franN8_1977 ;;605 differentiate between value and name keyword parameters by call P (name-key = arg1... value-key:=arg2)

Subtopic: call-by-name as virtual access up

Quote: a class may define virtual quantities for access from a super class; like call-by-name; compiler could check virtual specification [»dahlOJ_1967]

Subtopic: Jensen's device up

Quote: Jensen's device uses pass-by-name for both index and indexed quantity; e.g., allows nested summations [»maclBJ_1987]

Subtopic: problems with call by name up

Quote: use call by value instead of call by name; call by name needs the dynamic scope of the actual parameter
[»dahlOJ_1967]

Related Topics up

Group: procedure and type-valued variables   (4 topics, 95 quotes)

Topic: binding names to variables or expressions (10 items)
Topic: binding of names to objects (19 items)
Topic: macros (22 items)
Topic: named constants and expressions (21 items)
Topic: names as place holders (4 items)
Topic: parameters as argument place holders (15 items)
Topic: parameter passing by reference (11 items)
Topic: procedure valued variables
(34 items)


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