• 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/9

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;

9 Cards in this Set

  • Front
  • Back

immutable

an object who state cannot be modified after it is created

function binding (syntax)

fun x0 (x1 : t1, ..., xn : tn) = e;


where the function name is x0. It takes n arguments x1, ... xn of types t1, ..., tn and has an expression e for its body.

function binding (type checking)


fun x0 (x1 : t1, ..., xn : tn) = e;


for the function binding to type-check, the body e must have the type t, i.e. the result type of x0.

function binding (evaluation)

fun x0 (x1 : t1, ..., xn : tn) = e;


a function is a value- we simply add x0 to the environment as a function that can be called later.

recursive

a function definition can use itself.

type inference

figuring out types not written down

function calls (syntax)

The syntax is e0 (e1, ..., en) with the parentheses optional if there is exactly one argument.

function calls (type checking)

typing rules require that e0 has a type that looks like t1 * ... * tn -> t and for 1 ≤ i ≤ n, ei has type ti. Then the whole call has type t.

function calls (evaluation)

use the environment at the point of the call to evaluate e0 to v0, e1 to v1, ..., en to vn.