On this page:
begin-on-demand
6.1.1

13 Lazy Require

Ryan Culpepper <ryanc@racket-lang.org>

This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.

 (require unstable/lazy-require) package: unstable-lib

syntax

(begin-on-demand #:export (fun-id ...)
   body ...+)
Defines each fun-id as a function that, when called, dynamically loads and executes the body forms. The body forms must contain definitions for each fun-id, and the value of each fun-id must be a function.

A body form may be any module-level form except provide. In particular, require forms are allowed.

The body forms are placed within a submodule that extends the scope of the enclosing module (ie, module* with #f in the language position). Consequently, any references to sibling submodules must include a with ".." module path element.