This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.out
404 lines (404 loc) · 3.55 KB
/
tests.out
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
;;; R7RS
;;; 1. Overview of Scheme
;;; 1.3. Notation and terminology
;;; 1.3.4. Evaluation examples
40
";;; 2. Lexical conventions"
";;; 2.2. Whitespace and comments"
3628800
;;; 4. Expressions
;;; 4.1. Primitive expression types
;;; 4.1.1. Variable references
28
;;; 4.1.2. Literal expressions
a
#(a b c)
(+ 1 2)
a
#(a b c)
()
(+ 1 2)
(quote a)
(quote a)
145932
145932
"abc"
"abc"
#(a 10)
#(a 10)
#u8(64 65)
#u8(64 65)
#t
#t
;;; 4.1.3. Procedure calls
7
12
;;; 4.1.4. Procedures
#<procedure>
8
3
10
(3 4 5 6)
(5 6)
;;; 4.1.5. Conditionals
yes
no
1
;;; 4.1.6. Assignments
3
#<void>
5
;;; 4.2. Derived expression types
;;; 4.2.1. Conditionals
greater
equal
2
composite
#<void>
c
#t
#f
(f g)
#t
#t
#t
#f
(b c)
12
#<void>
#<void>
;;; 4.2.2. Binding constructs
6
35
70
#t
35
(x y x y)
;;; 4.2.3. Sequencing
6
4 plus 1 equals 5
;;; 4.2.4. Iteration
#(0 1 2 3 4)
25
((6 1 3) (-5 -2))
;;; 4.2.5. Delayed evaluation
3
(3 3)
2
5
#<promise>
6
#<promise>
6
#f
#f
#<promise>
;;; 4.2.6. Dynamic bindings
"12"
"c"
"12"
;;; 4.2.7. Exception handling
42
(b . 23)
;;; 4.2.8. Quasiquotation
(list 3 4)
(list a (quote a))
(a 3 4 5 6 b)
((foo 7) . cons)
#(10 5 2 4 3 8)
(list 3 4)
(quasiquote (list (unquote (+ 1 2)) 4))
;;; 4.2.9. Case-lambda
(0 1 2)
(3 4)
;;; 4.3. Macros
;;; 4.3.1. Binding constructs for syntactic keywords
;;; 4.3.2. Pattern language
ok
;;; 5. Program structure
;;; 5.1. Programs
;;; 5.3. Variable definitions
;;; 5.3.1. Top level definitions
6
1
;;; 5.3.3. Multiple-value definitions
(4 1)
3
;;; 5.5. Record-type definitions
#t
#f
1
2
3
;;; 6. Standard procedures
;;; 6.1. Equivalence predicates
#t
#f
#t
#f
#t
#t
#t
#f
#f
#t
#f
#t
#f
#f
#f
#t
#f
#t
#f
#f
#f
#f
#f
#f
#t
#t
#f
#f
#f
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#f
;;; 6.2. Numbers
;;; 6.2.6. Numerical operations
#t
#t
#t
#t
#f
#t
#f
#f
#t
#f
#t
#f
4
4.000000
7
-1
7
#t
1
1
3
-1
-3
1
-1
-1
-1.000000
2 1
-3 1
-3 -1
2 -1
2 1
-2 -1
-2 1
2 -1
2.000000 -1.000000
4
0
288
288.000000
1
-5.000000
-4.000000
-4.000000
-4.000000
3.000000
4.000000
3.000000
4.000000
7
1764
4.000000
2 0
2 1
;;; 6.2.7. Numerical input and output
#t
100
256
100.000000
;;; 6.3. Booleans
#t
#f
#f
#f
#f
#f
#t
#f
#f
#f
#t
#f
#f
;;; 6.4. Pairs and lists
(a b c)
#t
#<void>
(a . 4)
#t
(a . 4)
#f
#<void>
#t
#t
#f
#f
(a)
((a) b c d)
("a" b c)
(a . 3)
((a b) . c)
a
(a)
1
(b c d)
2
#<void>
#t
#t
#f
(3 3)
(a 7 c)
()
3
3
0
(x y)
(a b c d)
(a (b) (c))
(a b c . d)
a
(c b a)
((e (f)) d (b c) a)
c
c
(one two three)
(a b c)
(b c)
#f
#f
((a) c)
("b" "c")
(101 102)
(101 102)
(a 1)
(b 2)
#f
#f
((a))
(2 4)
(5 7)
(5 7)
(3 8 2 8)
(1 8 2 8)
;;; 6.5. Symbols
#t
#t
#f
#t
#f
#f
"flying-fish"
"Martin"
"Malvina"
mISSISSIppi
#t
#t
#t
;;; 6.6. Characters
#t
3
#f
;;; 6.7. Strings
"The word \"recursion\" has many meanings."
"Another example:\ntwo lines of text"
"Here's text containing just one line"
"a is named GREEK SMALL LETTER ALPHA."
#<void>
"a12de"
;;; 6.8. Vectors
#(0 (2 2 2 2) "Anna")
#(a b c)
8
13
#(0 ("Sue" "Sue") "Anna")
(dah dah didah)
(dah)
#(dididit dah)
#(#\A #\B #\C)
"123"
#(3 8 2 8)
#(8 2)
#(10 1 2 40 50)
#(a b c d e f)
#(1 2 smash smash 5)
;;; 6.9. Bytevectors
#u8(12 12)
#u8(1 3 5 1 3 5)
#u8()
8
#u8(1 3 3 4)
#u8(3 4)
#u8(10 1 2 40 50)
#u8(0 1 2 3 4 5)
"A"
#u8(65)
;;; 6.10. Control features
#t
#f
#t
#f
#t
7
30
(b e h)
(1 4 27 256 3125)
(5 7 9)
(1 2)
"IBM"
#(b e h)
#(1 4 27 256 3125)
#(5 7 9)
#(1 2)
#(0 1 4 9 16)
(101 100 99 98 97)
(0 1 4 9 16)
-3
4
#f
5
(connect talk1 disconnect connect talk2 disconnect)
;;; 6.11. Exceptions
condition: an-error
exception
should be a number
65
;;; 6.12. Environments and evaluation
21
20
;;; Example
#(1 0)
#(0.998951 0.000010)
#(0.997802 0.000020)