Linux command
racket 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start REPL
racket
Run script
racket [script.rkt]
Evaluate expression
racket -e "(+ 1 2 3)"
Run with specific language
racket -l [typed/racket] [script.rkt]
Interactive with file
racket -it [script.rkt]
Compile to bytecode
raco make [script.rkt]
Create executable
raco exe [script.rkt]
说明
racket is the main implementation of Racket, a general-purpose programming language in the Lisp/Scheme family. The language emphasizes language-oriented programming. The #lang directive at file start selects the language: racket, typed/racket, scribble, and many others. The REPL provides interactive development. Tab completion, history, and inline documentation support exploratory programming. raco is the Racket command tool for package management, compilation, documentation, and other tasks. It extends Racket's capabilities. Typed Racket adds optional static typing. Type annotations catch errors at compile time while maintaining Racket's expressiveness. The DrRacket IDE provides a graphical environment with debugging, profiling, and educational features.
参数
- -e _EXPR_
- Evaluate expression.
- -l _LANG_
- Use language.
- -f _FILE_
- Load file.
- -t _FILE_
- Require file.
- -i
- Interactive mode.
- -it _FILE_
- Load and interact.
- -I _LANG_
- Set language and interact.
- -m, --main
- Run main submodule.
- -v, --version
- Show version.
- -h, --help
- Show help.
- --
- End options.
FAQ
What is the racket command used for?
racket is the main implementation of Racket, a general-purpose programming language in the Lisp/Scheme family. The language emphasizes language-oriented programming. The #lang directive at file start selects the language: racket, typed/racket, scribble, and many others. The REPL provides interactive development. Tab completion, history, and inline documentation support exploratory programming. raco is the Racket command tool for package management, compilation, documentation, and other tasks. It extends Racket's capabilities. Typed Racket adds optional static typing. Type annotations catch errors at compile time while maintaining Racket's expressiveness. The DrRacket IDE provides a graphical environment with debugging, profiling, and educational features.
How do I run a basic racket example?
Run `racket` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e _EXPR_ do in racket?
Evaluate expression.