aboutsummaryrefslogtreecommitdiffstats
path: root/other/sage-scheme-notes.txt
blob: b366683730a8ec74e2bfb649f5befc9f3831c02a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
scm or MIT/GNU Scheme in Sage
=======================================

First install scm, MIT/GNU Scheme, or scmutils on your system. If you're doing
scmutils do it in /usr/local/ as recommended.

Then copy mitscheme.py and/or scm.py to SAGE_ROOT/devel/sage/sage/interfaces/
and edit all.py to include the lines:

    from mitscheme import mitscheme, mitscheme_console, MitScheme
    from scm import scm, scm_console, SCM

and edit the list of interfaces to include 'scm' and 'mitscheme'. For notebook
cell use, edit SAGE_ROOT/devel/sage/server/notebook/notebook.py and add 
'scm (optional)' and 'scmutils (optional)' to the list of interfaces.

If you want plain mit-scheme instead of all the scmutils packages, edit
mitscheme.py and replace the long 'command' declaration near the top with the
short commented out declaration.

Then return to your root sage directory (SAGE_ROOT) and do:

    $ ./sage -b

See if it works, eg:

    sage: m = MitScheme()
    Starting MIT/GNU Scheme Interpreter
    sage: m.eval('(+ 1 1)')
    '2'
    sage: one = mitscheme(1)
    '1'
    sage: two = mitscheme(2)
    '2'
    sage: one + two
    '3'

Much to do!