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

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;

8 Cards in this Set

  • Front
  • Back

Scope of a binding

where one variable can be called. In ML, the let expression/called variables can only be called following the operation to set the value.

ML Let Expression

Syntax:


let b1 b2 ... bn in e end


Each b1 is a binding, and e is an expression



Type-checking:


Whole expression is type e, and b1 and e are type checked in the static environment that has all previous bindings.



Evaluation:


Evaluate b1 and e in dynamic environment with all previous bindings. Result of whole expression is result of evaluating e.

ML Options

Synonymous with list constructs without fundamental errors of using 1 or 0 as return base for empty lists. A different construct from list though.



Holds type t;


NONE for empty build that holds 0 items,


SOME e for partial builds with expression.



isSome checks for NONE or SOME option


valOf pulls from SOME build, exception if NONE


Andalso

e1 andalso e2


Evaluates e2 only if e1 evaluates to true. The result is true if e1 and e2 evaluate to true.

Orelse

e1 orelse e2


Evaluates e2 only if e1 evaluates to false. The result is true if e1 or e2 evaluates to true

Immutable Data

data that cannot have its value changed permanently, standard in ML where data is only changed in the environment

Aliasing

creates a copy of a certain value

Idioms

recognizing certain patterns required, and knowing when to use certain expressions