开发者

Scheme dialect of Lisp in Emacs [closed]

开发者 https://www.devze.com 2023-01-13 23:14 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_开发问答

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question

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)?


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


Jerome's answer is a good simple way to get started. If you plan on working through longer exercises in SICP, I strongly suggest installing Quack, which is an Emacs package that provides many useful features for formatting, editing, and running Scheme code. It's the de facto standard.

You'll still have to install your preferred dialect of Scheme (I also suggest Racket here) independently, and then use Emacs to communicate with it.

This page and this other page might help you with some other resources for setting up and using Emacs for this purpose.


You don't, at least not directly. What people generally do is spawn a scheme process and communicate directly with that.

See external-lisp documentation for how to do that, as well as the Emacs Wiki page for Scheme.

Ok, I was a little wrong, it looks as though a couple of people have written Scheme interpreters on top of Emacs Lisp (see the Wiki link above), though they are not fully featured Schemes.


You don't. GNU Emacs LISP is built into GNU Emacs, and much of GNU Emacs is written in GNU Emacs LISP. You can't change the built-in LISP interpreter without massively breaking Emacs.

GNU/MIT Scheme includes the Edwin editor, an Emacs-like editor written in Scheme. You might be able to use that instead of GNU Emacs.

The other guy's recommendation of spawing a scheme process and communicating with that seems like the better idea.


I found it was easiest to use MIT scheme in Emacs with M-x run-scheme - instructions for setting this up are here:

http://praveen.kumar.in/2011/03/06/gnu-emacs-and-mit-scheme-on-mac-os-x/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号