At the end of this unit, students will be able to...
Explain the concept of subprograms (also known as functions, procedures, or methods) and their role in programming languages.
Categorize functions based on their return types (e.g., void functions vs. functions that return a value) and understand how this affects their usage and behavior in programming languages.
Specify functions as mapping rules, algorithms, operators, abstractions, subprograms, and messages, and understand the differences between these approaches to defining functions.
Explain subprogram mechanisms, including how subprograms are defined, called, and executed in programming languages.
Diferentiate definitions from declarations, and understand the role of each in programming languages.
Understand function pointers and their use in programming languages, including how they allow for higher-order functions and dynamic behavior.
Create subprograms in Lisp, Smalltalk, Ruby, C++, and Ada, and understand the syntax and semantics of function definitions in each language.
Explain how activation (a call to a subprogram) works, including the concept of the call stack and how parameters are passed to subprograms.
Parameter passing: explain the differences between pass-by-value, pass-by-reference, and pass-by-name, and understand the implications of each approach for function behavior and performance.