Lecture 2 - Page 27 : 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
Other simple types
Besides numbers, Scheme also supports booleans, characters, and symbols
Booleans
True
is denoted by
#t
and
false
by
#f
Every non-
false
values count as true in
if
and
cond
Characters
Characters are denoted as #\a, #\b, ...
Some characters have symbolic names, such as #\space, #\newline
Symbols
Symbols are denoted by quoting their names:
'a
,
'symbol
, ...
Two symbols are identical in the sense of
eqv?
if and only if their names are spelled the same way
R5RS: Booleans
R5RS: Characters
R5RS: Symbols
R5RS: Equivalence predicates