18 Requiring Modules

▼ |  | Unstable

1 | Guidelines for developing unstable libraries
2 | Bytes
3 | Classes and Objects
4 | Contracts
5 | Definitions
6 | Dictionaries
7 | Directories
8 | Exceptions
9 | Filesystem
10 | Functions
11 | Lists
12 | Net
13 | Path
14 | PLane T Packages
15 | Ports
16 | Pretty-Printing
17 | Regular Expressions
18 | Requiring Modules
19 | Sandboxed Evaluation
20 | Scribble Documentation
21 | Sets
22 | S-Expression Diff
23 | Source Locations
24 | Strings
25 | Structs
26 | Syntax
27 | Planet Package Macros
28 | Text Representations
29 | Multiple Values
30 | XML and CSS
31 | Polymorphic Contracts
32 | Finding Mutated Variables
33 | Find
34 | Interface-Oriented Programming for Classes
35 | Sequences
36 | Hash Tables
37 | Match
38 | Generics
39 | Mark Parameters
40 | Debugging
41 | Contracts for macro subexpressions
42 | GUI libraries

On this page:

require/ provide
quote-require
define-planet-package
define-collection
this-package-in

Version: 5.0.1.5
top← prev up next →

### 18`` Requiring Modules

( require unstable/require)

This module provides tools for importing from modules.

( require/provide module-path ...)

Re-exports all bindings provided by each module-path. Equivalent to:

( require module-path ...)
( provide ( all-from-out module-path ...))

( quote-require require-spec ...)

Produces the names exported by the require-specs as a list of symbols.

Example:
> ( quote-require racket/bool racket/function)
'(false true symbol=? false? boolean=? negate curryr curry const)

( define-planet-package name package)

Defines a shortcut name for importing modules from planet package package. Subsequently, (name module) is equivalent to ( planet package/module) as a require path. For instance, to import the text and web modules from this package:

( define-planet-package my-package cce/scheme)
( require (my-package web) (my-package text))

The above require is equivalent to:

( require ( planet cce/scheme/web) ( planet cce/scheme/text))

( define-collection name collect)

Defines a shortcut name for importing modules from collect and its subcollections. Subsequently, (name) is equivalent to collect as a require path, and (name path) is equivalent to collect/path.

( define-collection macro syntax)
( require (macro parse))

The above require is equivalent to the below:

( require syntax/parse)

( this-package-in path)

This require transformer imports the file at path in the current planet package. For instance, in the package ( planet cce/scheme:7), writing:
( require ( this-package-in function))
... is equivalent to writing:
( require ( planet cce/scheme:7/function))
top← prev up next →