Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheme dialect of Lisp in Emacs [closed]

Tags:

emacs

lisp

How do I get the EMACS lisp interpreter use the Scheme dialect of LISP. I am going over the SICP book and am new to EMACS (just finished learning the navigation and file access commands)?

like image 408
Russ W Avatar asked Aug 27 '10 15:08

Russ W


People also ask

Is Emacs written in Lisp?

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter.

Is Emacs Lisp compiled or interpreted?

Emacs Lisp has a compiler that translates functions written in Lisp into a special representation called byte-code that can be executed more efficiently.

How do I run a Lisp program in Emacs?

In a fresh Emacs window, type ESC-x lisp-interaction-mode . That will turn your buffer into a LISP terminal; pressing Ctrl+j will feed the s-expression that your cursor (called "point" in Emacs manuals' jargon) stands right behind to LISP, and will print the result.


1 Answers

To do SICP, you should use an external scheme interpreter as Emacs Lisp is different from Scheme and no correct implementation of scheme has been created on top of Emacs Lisp. One other reason you should use an external scheme interpreter is for speed of execution.

The simple solution is to use PLT Scheme now called Racket :

  • Download and Install scheme from Racket site.

  • Then configure the variable scheme-program-name to the value mzscheme

  • Finally run the command run-scheme : it will run mzscheme process into a *scheme* buffer.

The *scheme* buffer use the inferior-scheme-mode major mode which defines the following keys :

C-c C-k scheme-compile-file

C-c C-l scheme-load-file

C-x C-e scheme-send-last-sexp

C-M-x scheme-send-definition

like image 55
Jérôme Radix Avatar answered Sep 30 '22 16:09

Jérôme Radix