Running scmutils in a preinstalled MIT/GNU Scheme

674 views
Skip to first unread message

Jose A. Ortega Ruiz

unread,
Aug 18, 2005, 4:08:10 PM8/18/05
to si...@googlegroups.com

Hi. Although the scmutils package runs out of the box on GNU/Linux, it
comes with a whole MIT/GNU Scheme binary and starts the bundled Edwin
editor by default. I prefer running it using my installed MIT Scheme
(via the corresponding Debian package), and run the scheme REPL inside
Emacs (which i use heavily for all kind of tasks). I've thought that
may be other people by here would be interested in knowing how i do
that.

* When you untar the scmutils, there's a subdirectory 'src' inside. cd
there and start MIT/GNU Scheme (in my box, it is called simply
'scheme'). You're greeted with the prompt 1]=>
* Load compile.scm and load.scm:
1]=> (load "compile.scm")
... lots of stuff ...
2]=> (load "load.scm")
* At this point, you can use all the scmutils utilities. I then save
the 'world' using 'disk-save'
3]=> (disk-save "mechanics.band" "SICM")
* This creates a file mechanics.band that can be loaded in other
Scheme sessions, either interactively using (disk-restore
"mechanics.band"), or as an argument when executing 'scheme'. I've
created a shell script named 'mechanics' with the following
contents:

---------------------------------------------------
#!/bin/sh

SCHEME=scheme
MECH_BAND=/path/to/mechanics.band
CMD="${SCHEME} -band ${MECH_BAND}"

exec ${CMD}
---------------------------------------------------

where /path/to/mechanics.band is the path to the disk image you
created (you don't need to keep it in 'src'; it can be moved
wherever you prefer). Then, executing the scripts starts MIT Scheme
with the scmutils package loaded and ready.

* Inside Emacs, i do M-x run-scheme and, when asked, i specify
'mechanics' as the scheme to run (i've put the above script in my
path). And there you are: running MIT/GNU Scheme + scmutils inside
Emacs.

* If you're using Emacs for editing Scheme code, i heavily recommend
quack (http://www.neilvandyke.org/quack/) and paredit.el
(http://www.bloodandcoffee.net/campbell/paredit.el)

Hope this helps,
jao
--
The folly of mistaking a paradox for a discovery, a metaphor for a proof, a
torrent of verbiage for a spring of capital truths, and oneself for an
oracle, is inborn in us. -Paul Valery, poet and philosopher (1871-1945)
Reply all
Reply to author
Forward
0 new messages