2.1.4 Provide Statements

A provide statement comes in one of two forms:

‹provide-stmt›: provide ‹stmt› end | provide *

Both forms have no effect when the program is run as the top-level program.

When the program is in a file that is evaluated via import, the program is run, and then the provide statement is run in top-level scope to determine the value bound to the identifier in the import statement.

In the first form, the stmt internal to the provide is evaluated, and the resulting value is provided.

The second form is syntactic sugar for:

provide { id: id, ... } end

Where the ids are all the toplevel names in the file defined with fun, data, or x = e.