2.5 Subroutines

A procedure is a name for a sequence of statements. A function is a name for a sequence of statements which computes a value.

Which does the language have?

Properties

Does the function or procedure name depend on parameter types (signature)?

Does the binding between signature and statement sequence depend on argument(s) (method)?

Which data types can a function deliver as a result?

Is recursion allowed, forbidden but detected, or simply forbidden?

Can global variables be changed by a subroutine?

Can subroutines be programmed in other languages?

Parameters

Can subroutines have parameters?

Which data types can be used for parameters and for arguments?

Which conversions are implicit, if any?

How are arguments and parameters related:

by value

argument value is copied

by value return

parameter value is copied back

by address

parameter aliases any argument

by reference

parameter aliases only l-value as argument

by name

effectively, text of argument is used in place of parameter

Does caller or subroutine decide how a parameter is passed?