14.3 The racket/load Language
|#lang racket/load||package: base|
The namespace for evaluation shares the module registry with the racket/load module instance, but it has a separate top-level environment, and it is initialized with the bindings of racket. A single namespace is created for each instance of the racket/load module (i.e., multiple modules using the racket/load language share a namespace). The racket/load library exports only #%module-begin and #%top-interaction forms that effectively swap in the evaluation namespace and call eval.
For example, the body of a module using racket/load can include module forms, so that running the following module prints 5:
#lang racket/load (module m racket/base (provide x) (define x 5)) (module n racket/base (require 'm) (display x)) (require 'n)
#lang racket/load (define x 6) (display (eval 'x))
Since all forms within a racket/load module are evaluated in the top level, bindings cannot be exported from the module using provide. Similarly, since evaluation of the module-body forms is inherently dynamic, compilation of the module provides essentially no benefit. For these reasons, use racket/load for interactive exploration of top-level forms only, and not for constructing larger programs.