Emacs Builds racket development environment
Emacs under the development of racket environment, the author used the following two modes: Geiser and Racket-mode. Relatively speaking, the latter way to appear simple, this article mainly introduces the latter way of setting up the environment (note: The author is a Mac system, other systems similar):
Download and install Racket
The first thing you have to do is download racket's compilation and runtime environment for http://download.racket-lang.org/. The author is a Mac system, download good. dmg files directly after installation is good, very convenient.
Execution path
After installation, make sure that the racket executable file is in your $path (window is called environment variable), under Terminal, run the following command, if the following results indicate that the installation racket successful.
~ --versionto Racket v6.2.
The racket executable file in Mac is under this path:
/Applications/Racket\ v6.2/bin
For convenience, I made a soft link to my own/usr/local/bin under the
ln -s /Applications/Racket\ v6.2/bin/racket /usr/local/bin/racketln -s /Applications/Racket\ v6.2/bin/raco /usr/local/bin/raco
Emacs Installation Racket-mode
To install through MELPA, first set up the installation source:
(require ‘package)(add-to-list ‘package-archives ‘("melpa" . "http://melpa.org/packages/") t)(package-initialize)
Then install it with the following Emacs command
M-x package-install<ret> racket-mode
Emacs Configuration
(require ‘racket-mode)(setq racket-racket-program "racket")(setq racket-raco-program "raco")(add-hook ‘racket-mode-hook (lambda () (define-key racket-mode-map (kbd "C-x C-j") ‘racket-run)))
Note: The last line is the binding execution accelerator.
Perform
Here is a simple racket program, save it as a Hello.rkt file
#! /usr/bin/env racket#lang racket(define (extract str) 47"the cat out of the bag")
Execute this procedure, using the M-x racket-run command
Such as:
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Emacs Builds racket development environment