hamacs/ha-programming-scheme.org
2022-03-03 15:13:48 -08:00

2.6 KiB
Raw Blame History

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

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