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

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;

4 Cards in this Set

  • Front
  • Back

ML Tuples

ML supports tuples by allowing any number of parts. Even with tuples the type specifies how many parts it has. That is often too restrictive

ML Lists

we may need a list of data (say integers) and the length of the list is not yet known when we are type-checking (it might depend on a function argument). ML has lists, which are more flexible than pairs because they can have any length, but less flexible because all the elements of any particular list must have the same type.

Scope of a Binding

where it can be used,” so the scope of a binding in a let-expression is the later bindings in that let-expression and the “body” of the let-expression (the e)

ML let expression (syntax, semantics, type checking)

ML programming is done by defining an expression and giving a name to it for subsequent use. Examples we have seen so far, names are all recorded at the top-level. However, a large program requires a large number of names, many of which are only temporarily used. For example, fact function in the previous section is defined using loop function, but this name loop is only used in fact; other function would need another version of loop. Such a name should be defined as a local name to the function that use the name. For this purpose, ML provide the following let expression.