Next: , Previous: , Up: Program structure   [Index]


5.2 Import declarations

An import declaration takes the following form:

(import ⟨import-set⟩ …)

An import declaration provides a way to import identifiers exported by a library. Each ⟨import set⟩ names a set of bindings from a library and possibly specifies local names for the imported bindings. It takes one of the following forms:

In the first form, all of the identifiers in the named library’s export clauses are imported with the same names (or the exported names if exported with rename). The additional ⟨import set⟩ forms modify this set as follows:

In a program or library declaration, it is an error to import the same identifier more than once with different bindings, or to redefine or mutate an imported binding with a definition or with set!, or to refer to an identifier before it is imported. However, a REPL should permit these actions.


Next: Variable definitions, Previous: Programs, Up: Program structure   [Index]