ML Lecture 7

Lets step back and review what we learned about ML

ML is a functional language

  1. Everything is expression-based (not sequence of statements)
  2. Identifiers refer to values
  3. 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
  1. defined with a fun statement; ML just remembers that the function name refers to that expression (along with parameters, etc.)
  2. called when used in an expression; each call has different arguments
  3. arguments may be expressions as well
Identifier and parameter and function names
  1. Differences and similarities
  2. 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