▼ |  | Unstable: May Change Without Warning

1 | Guidelines for Developing unstable Libraries
2 | Automata: Compiling State Machines
3 | Bytes
4 | Contracts
5 | Contracts for Macro Subexpressions
6 | Debugging
7 | Definitions
8 | Errors
9 | Filesystem
10 | Find
11 | Flonums
12 | Futures
13 | Functions
14 | Hash Tables
15 | Interface-Oriented Programming for Classes
16 | Lazy Require
17 | Lists
18 | Logging
19 | Macro Testing
20 | Mark Parameters
21 | Match
22 | Open place expressions
23 | Options
24 | Parameter Groups
25 | Pretty-Printing
26 | Re-Contracting Identifiers
27 | Sandbox
28 | Sequences
29 | Strings
30 | Structs
31 | Struct Printing
32 | Syntax
33 | Temporal Contracts: Explicit Contract Monitors
34 | Unix Domain Sockets
35 | 2D Syntax
36 | GUI Libraries

On this page:

begin-on-demand

5.3.6
top ← prev up next →

### 16`` 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)

> > 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.

top ← prev up next →