2.6 KiB
2.6 KiB
Programming in Scheme for SICP
A literate programming file configuring Emacs.
Introduction
First, install MIT-Scheme, the Lisp dialect used throughout the book:
brew install mit-scheme
or sudo apt install mit-scheme
.
brew install mit-scheme
Ah, hell, we should install them all!
brew install guile racket chicken
Install Scheme
The geiser project attempts to be the interface between Emacs and various Schemes.
(use-package geiser
:init
(setq geiser-mit-binary "/usr/local/bin/scheme"
geiser-active-implementations '(mit))
:config
(use-package geiser-mit) ; Choose favorite
(add-to-list 'org-babel-load-languages '(scheme . t)))
Install SICP
Let’s get the book available as an Info page:
(use-package sicp)
Try it Out
(define (fib n)
(if (< n 2) 1
(+ (fib (- n 1)) (fib (- n 2)))))
(fib 5)