Lecture 2 - Page 39 : 46
Functional Programming in Scheme
Expressions, Types, and Functions
* Lisp and Scheme
Lisp
Scheme
* Expressions and values
Expressions, values, and types
Examples of expressions and their values
Evaluation of parenthesized expressions
Arithmetic expressions
Equality in Scheme
The read-eval-print loop
* Types
Types
Type checking
Static type checking
An example of type checking
Types in functional programming languages
* Lists
Proper lists
Symbolic expressions and improper lists
Practical list construction
List functions
Association lists
Property lists
Tables as lists of rows
Programs represented as lists
* Other Data Types
Other simple types
Vectors
Strings
* Definitions
Definitions
* Functions
The function concept
Lambda calculus
Functions in Scheme
Function objects
Functions as first class values
Anonymous functions
Lambda expressions in Scheme
Optional parameters of Scheme functions (1)
Optional parameters of Scheme functions (2)
Closures
Function definition in Scheme
Simple web-related functions (1)
Simple web-related functions (2)
Function exercises
Lambda expressions in Scheme
(lambda (formal-parameter-list) expression)
(lambda formal-parameters-name expression)
Lambda expression characteristics in Scheme:
No type declaration of formal parameter names
Call by value parameters
In reality passing of references to lists and other structures
Positional and required parameters
(lambda (x y z)
expr
)
accepts exactly three parameters
Required and rest parameters
(lambda (x y z . r)
expr
)
accepts three or more parameters
Rest parameters only
(lambda r
expr
)
accepts an arbitrary number of parameters
Parameter passing in Scheme