Emacs Builds racket development environment

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.