Summary

Syntax and semantics are a powerful paradigm for learning a programming language. As we learn the features of OCaml, we're being careful to write down their syntax and semantics. We've seen that there can be multiple syntaxes for expressing the same semantic idea, that is, the same computation.

The semantics of function application is the very heart of OCaml and of functional programming, and it's something we will come back to several times throughout the course to deepen our understanding.

Let expressions can be used to provide local scope for variables: the binding is in scope only in the body of the let expression.

Terms and concepts

  • anonymous functions
  • assertions
  • binding
  • binding expression
  • body expression
  • debugging
  • defensive programming
  • definitions
  • documentation
  • dynamic semantics
  • evaluation
  • expressions
  • function application
  • function definitions
  • identifiers
  • idioms
  • if expressions
  • lambda expressions
  • let definition
  • let expression
  • libraries
  • metavariables
  • mutual recursion
  • pipeline operator
  • postcondition
  • precondition
  • printing
  • recursion
  • semantics
  • static semantics
  • substitution
  • syntax
  • tools
  • type checking
  • type inference
  • values

Further reading

  • Introduction to Objective Caml, chapter 3
  • OCaml from the Very Beginning, chapter 2
  • Real World OCaml, chapter 2

results matching ""

    No results matching ""