-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.OLD
More file actions
215 lines (158 loc) · 6.7 KB
/
README.OLD
File metadata and controls
215 lines (158 loc) · 6.7 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
This file is only contained here as a tribute to the orginal authors.
Please refer to the new README for more up-to-date information.
=====================================================================
---------- Mini-Scheme Interpreter Version 0.85 ----------
coded by Atsushi Moriwaki (11/5/1989)
E-MAIL : moriwaki@kurims.kurims.kyoto-u.ac.jp
MIX : riemann
NIFTY : PBB01074
(Note that these addresses are now obsolete, see below)
=====================================================================
Revised by Akira KIDA
Version 0.85k4 (17 May 1994)
Version 0.85k3 (30 Nov 1989)
Version 0.85k2 (28 Nov 1989)
Version 0.85k1 (14 Nov 1989)
Mini-Scheme is now maintained by Akira KIDA.
E-Mail : SDI00379@niftyserve.or.jp
Most part of this document is written by Akira KIDA.
Send comments/requests/bug reports to Akira KIDA at the above
email address.
=====================================================================
This Mini-Scheme Interpreter is based on "SCHEME Interpreter in
Common Lisp" in Appendix of T.Matsuda & K.Saigo, Programming of LISP,
archive No5 (1987) p6 - p42 (published in Japan).
Copyright Notice:
THIS SOFTWARE IS PLACED IN THE PUBLIC DOMAIN BY THE AUTHOR.
This software is completely free to copy, modify and/or re-distribute.
But I (Atsushi Moriwaki) would appreciate it if you left my name on the
code as the author.
DISCLAIMER:
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
Supported features (or, NOT supported features :-)
1) Lists, symbols, strings.
However, strings have very limited capability.
For instance, there is *NO* string-ref, string-set!, ... etc.
2) Numbers are limited to FIXNUM only.
There is *NO* complex, real, rational and even bignum.
3) Macro feature is supported, though not the one defined in R4RS.
Known problems:
1) Poor error recovery from illegal use of syntax and procedure.
2) Certain procedures do not check its argument type.
Installation:
1) Select system declaration and configuration options by editing
source file.
You may choose one of the following systems by #define'ing
the preprocessor symbol.
Supported systems are:
Macintosh:
LSC -- LightSpeed C (3.0) for Macintosh
LSC4 -- LightSpeed C (4.0) for Macintosh
They are different in #include header only.
I (kida) think THINK C 5.0, 6.0, 7.0 may be OK
with LSC4 configuration, though not tested.
MPW2 -- Macintosh Programmer's Workshop v2.0x
I don't tested v3.x or later.
DOS:
MSC4 -- Microsoft C v4.0 (use /AL)
MSC v5.1, v6.0, v7.0 are all OK.
TURBO2 -- Bolarnd's Turbo C v2.0 (use -ml)
Turbo C++ 1.0 is OK.
UNIX:
BSD -- UNIX of BSD flavor, ex. SuOS 4.x
SYSV -- UNIX of System-V flavor, ex. Sun/Solaris 2.x
VAX/VMS:
VAXC -- VAX-C v3.x (this symbol may be defined by the
compiler automatically).
2) Configure some preprocessor symbols by editing source files.
Configurable #define's are:
#define VERBOSE
-- if defined, GC messages is verbose on default.
#define AVOID_HACK_LOOP
-- if defined, do _NOT_ use loop construction in the
form
do { ... } while (0)
This form is used in macro expansion, since this is
the best "safety" blocking construct when used in
macro definition.
However, some compiler (including SunPRO CC 2.0.1)
is silly enough to warning this construct, like
"warning: end-of-loop code not reached", etc.
If you dislike such warning, please define this symbol.
NOTE: You may get some "statement not reached" warning
even if you have define this symbol. Please be patient,
or, use more smart compiler.
In short if you use GCC, undefine this and forget it
at all.
#define USE_SETJMP
-- if defined, use setjmp to global jump on error.
if not defined, avoid to use it. Compiled with
this symbol defined, the interpreter issue fatal
error and return to the operating system immediately
when we run out of free cells. By default, i.e.,
compiled with this symbol is not defined, the
interpreter will just return to the top level in
such a case.
May not be used except for compiling as Mac DA.
#define USE_MACRO
-- if defined, macro features are enabled.
#define USE_QQUOTE
-- if defined, you can use quasi-quote "`" in macro.
You can use macro even if this symbol is undefined.
3) Compile!
I think there is virtually no problem about how to compile.
Since there is exactly one C source file. :-)
If you are on UNIX boxes with some BSD flavors, instead of
using make command, it's enough to type:
cc -DBSD -O -o miniscm miniscm.c
You may have additional warnings like 'function should
return value'. This is due to omitting 'void' keyword
from the source in order to get pre-ANSI compatibility.
Usage : miniscm
Sorry, no command line argnumet is allowed.
Special procedures of this system:
gc : (gc) -- force garbage collection
gc-verbose : (gc-verbose bool) -- GC verbose on/off
Argument #f turnes off the GC message.
Enything else turn on the GC message.
quit : (quit) -- quit to the operating system
put : (put sym prop expr)
-- set the value of a property of a symbol.
get : (get sym prop)
-- get the value of a property of a symbol.
new-segment : (new-segment n)
-- allocate n new cell segments.
print-width : (print-width list)
-- returns 'printed' width of list.
closure? : (closure? obj)
-- test if obj is a closure or not.
macro? : (macro? obj)
-- test if obj is a macro or not.
note that a macro is also a closure.
get-closure-code
: (get-closure-code closure-obj)
-- extract S-expr from closure-obj.
Scheme files:
init.scm -- Automatically loaded at invocation.
Default setting assumes that this file is in the current
working directory.
Change #define InitFile if you don't like it.
tools.scm -- This is a sample file. Contains very tiny pretty-print
procedure.
After invoking miniscm, type:
(load "tools.scm")
and try
(pp getd)
(pp do)
Documents?:
Sorry, there is no other documents.
Do not ask one for me, please see the source instead. :-)
But if you _absolutely_ need help, please email to me at:
<SDI00379@niftyserve.or.jp>
Enjoy!
-- Akira KIDA
Sysop for FPL in NIFTY-Serve in JAPAN.
(FPL stands for 'Forum for Program-Language')