Card Range To Study

29 Cards in this Set

A ______ ______ describes the interface to a subprogram as well as the actions of the subprogram.

subprogram definition

A ______ ______ is an explicit request that a subprogram be executed.

subprogram call

A subprogram is _____ if it has been called but has not yet returned.

active

A ______ ______, the first line of a definition, serves several purposes:
- Indicates (often by a special word) the beginning of a subprogram definition, and may indicate whether the subprogram is a procedure or a function.
- Provides a name for the subprogram.
- May optionally specify a list of parameters.

subprogram header

Function declarations are called _____ in C and C++. Such declarations are
often placed in header files.

prototypes

The ______ ______ of a subprogram is the number, order, and types of its formal parameters.

parameter profile

The ______ of a subprogram is its parameter profile plus, if it is a function, its
return type.

protocol

Parameters in a subprogram header are called ______ ______.

formal parameters

A subprogram call specifies the name of the subprogram and a list of _____ ______ to be bound to the subprogram’s formal parameters.

actual parameters

In nearly all languages, the correspondence between actual and formal parameters
is done by position: The first actual parameter is bound to the first formal
parameter and so forth. Such parameters are called ______ ______.

positional parameters

One solution to this problem of long argument lists is to provide _______ _______, in which names of formal parameters are explicitly connected with actual parameters.

keyword parameters

Subprograms can define their own variables, called ______ ______.

local variables

The idea of nesting subprograms originated with ______ and direct
descendants, including _____, _____, and ______.

Algol 60

Algol 68, Pascal, and Ada

The C-based languages do not support nesting subprograms, but some newer languages do, including _____, ______, and ______.

JavaScript, Python, and Ruby

_______ methods are ways in which parameters are transmitted to and/or from called subprograms.

Parameter-passing

______ is a combination of pass-by-value and pass-by-result. It is an implementation model for inout-mode parameters in which actual values are
moved.

Pass-by-value-result

Pass-by-value-result is sometimes called ______ because the actual parameter is copied to the formal parameter at subprogram entry and then copied back at subprogram termination.

pass-by-copy

_____, _____ and ____ modes are for inout-mode parameters.

Pass-by-value-result, Pass-by-reference, Pass-by-name

______ is an inout-mode parameter transmission method that does not correspond to a single implementation model.

Pass-by-name

C++ allows reference parameters to be declared const. What does this do?

pass-by-reference but cannot be changed within the function.

Example declaration:
void fun(const int& p1, int p2, int& p3) { … }

Python and Ruby support ______, in which each actual parameter (a reference to an object) is assigned to the corresponding formal parameter. An actual parameter cannot be changed within a subprogram, but the object to which it refers can modified.

A ______ is a special kind of subprogram. Unlike conventional subprograms,
coroutines behave more like equals.

coroutine

Since control is often transferred to a coroutine at a point other than its beginning,
the invocation of a coroutine is called a _____, not a call.

resume

______ was the first high-level programming language to support coroutines.

SIMULA 67

Additionally, Other languages that support coroutines include BLISS, INTERLISP, and
Modula-2.

A coroutine may execute partially and then transfer control to another coroutine.
When restarted, a coroutine resumes execution just after the statement it used to
transfer control elsewhere. This sort of interleaved execution sequence is sometimes
called _____.

quasi-concurrency

The environment of the statement that calls the passed subprogram.

shallow binding

The environment in which the passed subprogram.

deep binding

The environment of the call that passed the subprogram as an actual parameter.