► |  | The Racket Reference

1 | Language Model
2 | Notation for Documentation
3 | Syntactic Forms
4 | Datatypes
5 | Structures
6 | Classes and Objects
7 | Units
8 | Contracts
9 | Pattern Matching
10 | Control Flow
11 | Concurrency and Parallelism
12 | Macros
13 | Input and Output
14 | Reflection and Security
15 | Operating System
16 | Memory Management
17 | Unsafe Operations
18 | Running Racket
| Bibliography
| Index

▼ | 18 | Running Racket

18.1 | Running Racket or GRacket
18.2 | Libraries and Collections
18.3 | Interactive Help
18.4 | Interactive Module Loading
18.5 | Debugging
18.6 | Kernel Forms and Functions

On this page:

help

top ← prev up next →

#### 18.3`` Interactive Help

(require racket/help) | package: base

The bindings documented in this section are provided by the racket/help and racket/init libraries, which means that they are available when the Racket executable is started with no command-line arguments. They are not provided by racket/base or racket.

> syntax help
> (help string ...)
> (help id)
> (help id #:from module-path)
> (help #:search datum ...)

For general help, see the main documentation page.

The help form searches the documentation and opens a web browser (using the user’s selected browser) to display the results.

> > > See net/sendurl for information on how the user’s browser is launched to display help information.

A simple help or (help) form opens the main documentation page.

The (help string ...) form—using literal strings, as opposed to expressions that produce strings—performs a string-matching search. For example,

> (help "web browser" "firefox")

searches the documentation index for references that include the phrase “web browser” or “firefox.”

A (help id) form looks for documentation specific to the current binding of id. For example,

> (require net/url)
> (help url->string)

opens a web browser to show the documentation for url->string from the net/url library.

For the purposes of help, a for-label require introduces a binding without actually executing the net/url library—for cases when you want to check documentation, but cannot or do not want to run the providing module.

> (require racket/gui) ; does not work in racket
> (require (for-label racket/gui)) ; ok in racket
> (help frame%)

If id has no for-label and normal binding, then help lists all libraries that are known to export a binding for id.

The (help id #:from module-path) variant is similar to (help id), but using only the exports of module-path. (The module-path module is required for-label in a temporary namespace.)

> (help frame% #:from racket/gui) ; equivalent to the above

The (help #:search datum ...) form is similar to (help string ...), where any non-string form of datum is converted to a string using display. No datum is evaluated as an expression.

For example,

> (help #:search "web browser" firefox)

also searches the documentation index for references that include the phrase “web browser” or “firefox.”

top ← prev up next →