software/scheme

Scheme

mit-scheme with the scmutils package is assumed; the command mechanics starts in interactive edwin prompt.

See also notes on The Little Schemer.

Scheme Implementations

Very partial list, mostly just the ones which are interesting to me. Alexey Radul maintains a nice table of R5RS implementation details in various packages on his website.

MIT/GNU Scheme

The 7.9.0 release (last stable as of 01/01/2009) is not R5RS compatible, and is generally a pain in the ass to compile on new systems. The 9.0 release should be easier to compile and distribute because it will use a C compiler to bootstrap (true?).

SCM

SCM is a fairly minimal, very small footprint R5RS-compatible implementation. Apparently very portable and easy to compile. Includes the Hobbit compiler. Part of the GNU project, maintained at MIT?

SIOD

SIOD (scheme in one day) is a super small (75k binary?) Scheme implementation.

Coding in edwin

Note: this section should be spun off as emacs. edwin is essentially a scheme version of emacs. See this `emacs cheatsheet <http://static.bnewbold.net/mirror/sheets/emacs.pdf>`_

Common keyboard commands (usually 'M' is alt button, 'C' is ctrl, and 'S' is meta/super/"windows"):

Shortcut Effect

C-x C-f

Open a file, or create a new one

C-x C-s

Save the file

C-x k

Kill (close) a buffer

C-x C-c

Exit the editor

C-g

Abort a command

C-x C-e

Evaluate the previous expression

M-z

Evaluate the surrounding expression

M-o

Evaluate the entire buffer (everything)

C-c C-c

Kill evaluation after an error

C-y

Paste (yank)

C-x 2

Split screen vertically

C-x 5

Split screen horizontally

C-x o

Switch to next buffer window

C-x 1

Return to non-split screen

M-x

Enter a command by name in minibuffer (use tab to complete)

C-x C-b

Show buffer menu

C-x b

Select buffer

C-x u

Undo

C-y Paste

Command in .edwin to set Super-TAB to autocomplete scheme variables:

(define-key 'Scheme #\s-tab 'scheme-complete-variable)

Scope

set! looks up a symbol name and permanently changes the first value it comes across. let (and letrec) create a new symbol with the given value. But wait, you need a lambda block to make everything work?

Environment/Interpreter Commands

(disk-save filename) will save a binary microcode image; an existing image can be specified with the --band option at runtime or with (disk-restore filename) from within the interpreter. Bands are also called worlds.

"First Class"

"Procedures as first class objects" is one of the features commonly attributed to scheme. What does that mean? SICP describes first class objects as those that can be: named by variables, passed as arguments, returned as results, and included in data structures.