ML Lecture 7
Lets step back and review what we learned about ML
ML is a functional language
-
Everything is expression-based (not sequence of statements)
-
Identifiers refer to values
-
Goals of using ML are to show similarity of computation and math, to use
a strict function input->output form of computation, and to show specification-style
of problem solving
Function definition versus function call
-
defined with a fun statement; ML just remembers that the function name
refers to that expression (along with parameters, etc.)
-
called when used in an expression; each call has different arguments
-
arguments may be expressions as well
Identifier and parameter and function names
-
Differences and similarities
-
Non-conflicting, do not need to be same
Stack of identifier-value bindings
Intermediate values: the let statement
Slides in class: function definitions,
and ML sessions