SML# Document Version 4.1.0
19 Expressions

19.9 Local declaration expression let declList in exp1;;expn end

A let expression let declList in exp1;;expn end allows you to introduce local declarations that are valid only in expressions exp1;;expn. This expression is evaluated as follows.

  1. 1.

    Each declaration in declList is evaluated sequentially and adds the resulting environment to the current environment.

  2. 2.

    Under the augmented environment, expressions exp1;;expn are evaluated in this order.

  3. 3.

    The type and value of the last expression is those of this entire expression.