• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/5

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

5 Cards in this Set

  • Front
  • Back

Immutable

ML Syntax dictates that we cannot change the value of 'x' to something else later on. We can shadow it, or even use an alias; but it remains Immutable.

Function Binding

Syntax: fun x0 (x1 : t1, x2 : t2..., xn : tn)



Type-Checking: maps x1 to t1, x2 to t2, ... resulting in type x0



Evaluation: add x0 to the envoirnment as a function that can be called later.

Recursive

The ability to 'work backwards' i.e. using the head or tail of a list, then coming back through from tail to head.

Type Inference

Syntax:



Type Checking:



Evaluation:

Function Calls

Syntax: fun <identifier> (<parameter list>) = <expression>;
e.g. fun square( x) = x * x;



Type Checking: Function calls are typechecked in the obvious way: the actual argument must match the formal argument type. When it does not, you get an error.



Evaluation:

* The return value is the entire body of the function. Since ML proceeds by evaluaton of expressions, this is a natural way to define functions: the body is an expression that gets evaluated. This design differs from imperative languages, where a function body is usually a block of code to be executed.