-
Notifications
You must be signed in to change notification settings - Fork 0
DrRacket
If you are a beginner or would like to use a graphical environment to run programs, run the DrRacket
executable.
On Windows, you can start DrRacket from the Racket entry in the Start menu. In Windows Vista or newer, you can just type DrRacket. You can also run it from its folder, which you can find in Program Files → Racket → DrRacket.
On Mac OS, double click on the DrRacket icon. It is probably in a Racket folder that you dragged into your Applications folder.
On Unix (including Linux), double click on the DrRacket icon if your distribution creates one, which is case for many environments. The drracket
executable can also be run directly from the command-line if it is in your path, which is probably the case if you chose a Unix-style distribution when installing. Otherwise, navigate to the directory where the Racket distribution is installed, and the drracket
executable will be in the "bin" subdirectory.
Using DrRacket is the fastest way to get a sense of what the language and system feels like, even if you eventually use Racket with Emacs, vi, or some other editor.
See the DrRacket documentation for a brief overview of the DrRacket IDE.
the definitions area
, which is the top text area that you see in DrRacket
Then click the Run button. You’ll see the text caret move to the bottom text area, which is the interactions area
.
If you’ve used DrRacket before, you might need to reset DrRacket to use the language declared in the source via the Language|Choose Language... menu item before clicking Run.
When you type an expression after the > in the interactions window and hit Enter, DrRacket evaluates the expression and prints its result.
Note that DrRacket highlights in pink the expression that triggered the error (but pink highlighting is not shown in this documentation).
If you wonder what other functions exist—perhaps a way to stack pictures vertically and left-aligned?—move the text caret to the name hc-append and press the F1 key in DrRacket. A browser window will open, and it will give you a link to the documentation for hc-append. Click the link, and you’ll see lots of other functions.
definitions area is where your program lives—it’s the file that you save—while the interaction area is for transient explorations and debugging tasks.
In the same way that definitions can be evaluated in the interactions area, expressions can be included in the definitions area. When a program is run, expression results from the definition area are shown in the interaction area.
Some collections of modules are distributed as packages. Packages can be installed using the Install Package... menu item in DrRacket’s File menu, or they can be installed using the raco pkg
command-line tool. For example, installing the "avl"
package makes the avl module available.
Packages can be registered at https://pkgs.racket-lang.org/, or they can be installed directly from a Git repository, web site, file, or directory. See Package Management in Racket for more information about packages.