Marcus Junius Brutus
Marcus Junius Brutus

Reputation: 27286

How can I open a function's documentation in the REPL?

Is there a way to get a function's documentation on DrRacket's REPL? E.g. something like:

(doc somefunction)

The documentation only mentions "external" resources.

Upvotes: 2

Views: 664

Answers (2)

Alexis King
Alexis King

Reputation: 43842

There are a couple of different ways to open documentation.

  • In the Racket REPL, type (help id) to get help for a particular identifier.

    The help binding is provided from the racket/help library, which is loaded at startup by default by the racket executable when started in interactive mode with no other command-lin arguments. It is not available by default in DrRacket. If it is unavailable, but you want to use it, just type (require racket/help) to import it first.

  • If XREPL is loaded, you can also type ,doc id to get help.

    To load XREPL, use (require xrepl) in the REPL. For more information, including information on loading XREPL by default, see its documentation.

  • In DrRacket, right-click an identifier and click "show documentation", or just press F1.

  • From the command-line, use raco docs query ... to search through the help index.

Upvotes: 4

Morpheus
Morpheus

Reputation: 1634

Documentation Search (http://docs.racket-lang.org/raco/docs.html)

Command-line flags:
Use -h or --help — show help information for this command

Upvotes: 0

Related Questions